zsh-users
 help / color / mirror / code / Atom feed
From: Mikael Magnusson <mikachu@gmail.com>
To: Roger Mason <rmason@mun.ca>
Cc: zsh-users@zsh.org
Subject: Re: strange behaviour of zparseopts
Date: Fri, 7 May 2021 13:05:28 +0200	[thread overview]
Message-ID: <CAHYJk3R8_PLyXAmp9TanomDr-W+=byFWSrZe78=16bg7o=-ZcQ@mail.gmail.com> (raw)
In-Reply-To: <y65h7jeq1iy.fsf@mun.ca>

On 5/7/21, Roger Mason <rmason@mun.ca> 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


      parent reply	other threads:[~2021-05-08 18:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-07 10:30 Roger Mason
2021-05-07 11:05 ` Daniel Shahaf
2021-05-07 17:26   ` Roger Mason
2021-05-07 11:05 ` Mikael Magnusson [this message]

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='CAHYJk3R8_PLyXAmp9TanomDr-W+=byFWSrZe78=16bg7o=-ZcQ@mail.gmail.com' \
    --to=mikachu@gmail.com \
    --cc=rmason@mun.ca \
    --cc=zsh-users@zsh.org \
    /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).