zsh-workers
 help / color / mirror / code / Atom feed
From: Oliver Kiddle <opk@u.genie.co.uk>
To: Zsh workers <zsh-workers@sunsite.auc.dk>
Subject: Re: zparseopts (Re: PATCH: _urls and _rpm)
Date: Tue, 06 Jun 2000 10:58:31 +0100	[thread overview]
Message-ID: <393CCB47.43BD74D7@u.genie.co.uk> (raw)
In-Reply-To: <1000606040813.ZM25973@candle.brasslantern.com>

On the subject of my IRIX 5.3 compilation warnings, Bart Schaefer wrote:
> What does line 111 of sys/types.h look like?

typedef unsigned long   ino_t;          /* <inode> type */

If you look back it my previous message (11755), you'll see that I had
stuck a section of types.h in at the end. The line is after a
preprocessor check for _MIPS_SZLONG == 32.

I'll try your sed suggestion out this evening, thanks.

Bart Schaefer wrote:
> 
> No, that's no good.  The whole point of calling it zparseOPTS is that the
> things it is parsing are *optional*.

Fair enough.

> } +zparseopts -D -E 'g:=glob'
>                     ^       ^                   Why the quotes?

Because I cut and paste the line from the example in 11532 without
thinking much about it.

> } +(( $#glob )) || glob=( -g '' )
> You could use
>         : ${(A)=glob:=-g '*(^/)'}

Very true, I forgot about that, I'll commit those changes sometime
later.

> What I can't decide is whether I like the behavior of emptying the array
> when no matching option is found.

Actually, this is how I initially assumed it would work and I tried it
out as you suggested.

and Sven wrote:
> Should we add an option for this?

An option seems slightly over-kill but I really can't decide which
behaviour I prefer either so maybe. You could also allow
g:=glob:-'*(^/)' but I'm not sure that wouldn't only be unnecessary
bloat to zparseopts.

Oliver

Index: Completion/User/_urls
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/User/_urls,v
retrieving revision 1.11
diff -u -r1.11 _urls
--- Completion/User/_urls       2000/06/05 23:20:48     1.11
+++ Completion/User/_urls       2000/06/06 09:55:41
@@ -52,8 +52,8 @@
   _wanted -C -f files expl file _files "$@" && return 0
 fi

-zparseopts -D -E 'g:=glob'
-(( $#glob )) || glob=( -g '*(^/)' )
+zparseopts -D -E g:=glob
+: ${(A)=glob:=-g '*(^/)'}

 ipre="$IPREFIX"


  reply	other threads:[~2000-06-06  9:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-06-05 22:09 PATCH: _urls and _rpm Oliver Kiddle
2000-06-06  3:48 ` Bart Schaefer
2000-06-06  4:08 ` zparseopts (Re: PATCH: _urls and _rpm) Bart Schaefer
2000-06-06  9:58   ` Oliver Kiddle [this message]
2000-06-07  5:55     ` Bart Schaefer
2000-06-06  7:15 Sven Wischnowsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=393CCB47.43BD74D7@u.genie.co.uk \
    --to=opk@u.genie.co.uk \
    --cc=zsh-workers@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).