Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: zparseopts and longopts
- X-seq: zsh-users 21566
- From: Atte Peltomaki <atte.peltomaki@xxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: zparseopts and longopts
- Date: Sun, 15 May 2016 18:06:55 +0300
- Cc: Zsh Users <zsh-users@xxxxxxx>
- In-reply-to: <CAH+w=7ZkukYXP4r1W9=_fEOGwzfqHtg9EeGpJxF=atYcOZFb0w@mail.gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <20160512111628.GG12777@ass.pp.htv.fi> <CAH+w=7ZkukYXP4r1W9=_fEOGwzfqHtg9EeGpJxF=atYcOZFb0w@mail.gmail.com>
On Fri, May 13, 2016 at 04:25:28AM -0700, Bart Schaefer wrote:
> On Thu, May 12, 2016 at 4:16 AM, Atte Peltomaki <atte.peltomaki@xxxxxx> wrote:
> > Executing with imaginary new option:
> >
> > % ./test.zsh --gnu argh --gnu-tard rms --gnu-tard-added-even-longer-opt whyohwhy
> > --gnu argh
> > --gnu-tard -added-even-longer-opt
>
> Well, you've told zparseopts that --gnu-tard is an option that takes a
> mandatory argument, and you have not told zparseopts that
> --gnu-tard-add... is an option, and the argument of an option is
> allowed to appear in the same word as the option itself (so that -a2
> is the same as -a 2), so zparseopts believes -add... is the argument
> of the option you told it about.
Makes sense, but also makes it impossible to use zparseopts with a
caller that may spontaneously add options and expect scripts to work
unmodified.
--
Atte Peltomäki
atte.peltomaki@xxxxxx <> http://kameli.org
"Your effort to remain what you are is what limits you"
Messages sorted by:
Reverse Date,
Date,
Thread,
Author