zsh-workers
 help / color / mirror / code / Atom feed
From: "Bart Schaefer" <schaefer@candle.brasslantern.com>
To: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>,
	zsh-workers@sunsite.auc.dk
Subject: Re: PATCH: file completion
Date: Wed, 9 Feb 2000 18:50:39 +0000	[thread overview]
Message-ID: <1000209185039.ZM1201@candle.brasslantern.com> (raw)
In-Reply-To: <200002091625.RAA17482@beta.informatik.hu-berlin.de>

On Feb 9,  5:25pm, Sven Wischnowsky wrote:
} Subject: PATCH: file completion
}
} I finally got fed up with those longish while-getopts loops
} and added a small builtin (zparseopts) that can be used to replace
} such loops.

This is not a bad idea, but I repeat my frequent plea that we stop
placing so much emphasis on compact syntax.  nopts qopts 1opts 2opts ?
It's like reading Dr. Suess.

Besides, it can't support long options, which somebody at some point
is going to start yelling for.

How about

	zparseopts [ -a arraname | -A assocname | -D ] optspec ...

where optspec looks like

	optionname["+"|":"]["="arrayname]

where of course + : = in optionname can be backslashed or whatever.

The -a option would mean to use that arrayname for any optspec where
the =arrayname part was left off; the -A assocname would mean to set
assocname[optionname] with the same semantics that getopts sets OPTARG.

It could also use the GNU getopt double-colon syntax for whether an
option takes a required (one colon) or optional (two colons) argument.

It's also not clear what happens when there's an argument parsing error
of some sort; does zparseopts just quit then and ignore the rest of the 
arguments, or what?

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com


  reply	other threads:[~2000-02-09 18:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-02-09 16:25 Sven Wischnowsky
2000-02-09 18:50 ` Bart Schaefer [this message]
2000-02-09 21:54 ` Tanaka Akira
2000-02-10 11:51 Sven Wischnowsky
2000-02-10 11:53 Sven Wischnowsky
2000-02-17  9:12 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=1000209185039.ZM1201@candle.brasslantern.com \
    --to=schaefer@candle.brasslantern.com \
    --cc=wischnow@informatik.hu-berlin.de \
    --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).