Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: strange behaviour of zparseopts
- X-seq: zsh-users 26718
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Roger Mason <rmason@xxxxxx>
- Cc: zsh-users@xxxxxxx
- Subject: Re: strange behaviour of zparseopts
- Date: Fri, 7 May 2021 13:05:28 +0200
- Archived-at: <https://zsh.org/users/26718>
- In-reply-to: <y65h7jeq1iy.fsf@mun.ca>
- List-id: <zsh-users.zsh.org>
- References: <y65h7jeq1iy.fsf@mun.ca>
On 5/7/21, Roger Mason <rmason@xxxxxx> wrote:
> Hello,
>
> The following minimal example illustrates the problem I am having.
>
> drat.sh
> ----------------------------------------------------------------------------------------------------------
> #!/usr/local/bin/zsh -f
>
> zparseopts -D -E -A elkopts -tasks: -maxthd: -scale: -xc: -mix: -scl:
> -spsource: -kx: -ky: -kz: -write: \
> -quality:
>
>
> zparseopts -D -E -A elkopts -actype:
>
> ----------------------------------------------------------------------------------------------------------
>
> The first invocation of zparseopts works (no error is returned). The
> second returns:
>
> ./drat.sh:zparseopts:7: missing option descriptions
>
> Swapping the order of the invocations has no effect (beyond changing the
> line number at which the error arises).
>
> I'm running zsh-5.8 on freebsd-11.4.
>
> Thanks for any help offered.
I'm reasonably sure you just want
zparseopts -D -E -A elkopts - -actype:
otherwise the -a is taken as an option for zparseopts:
-a -- specify array in which to store parsed options
It is the only lowercase option for zparseopts and unknown options
seem to serve the same purpose of terminating the option list and
starting the argument list which is why the first command works.
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author