From: Bart Schaefer <schaefer@brasslantern.com>
To: Oliver Kiddle <opk@zsh.org>
Cc: Roger Mason <rmason@mun.ca>, Zsh Users <zsh-users@zsh.org>
Subject: Re: zparesopts odd behaviour
Date: Wed, 27 Oct 2021 17:05:11 -0700 [thread overview]
Message-ID: <CAH+w=7ZumMMEm=DfL22UgG9o4yJC5T-mz0OC5tR6Tfa=KHbM9Q@mail.gmail.com> (raw)
In-Reply-To: <90229-1635369736.574681@2LDn.bDIk.puks>
On Wed, Oct 27, 2021 at 2:22 PM Oliver Kiddle <opk@zsh.org> wrote:
>
> On 2 Sep, Roger Mason wrote:
> > ./testopts.sh --sc1 5.5 --sc2 5.5 --sc3 8.0 --sc 1.5
>
> zparseopts allows values to appear immediately after the option. So
> --sc3 is taken as being the same as --sc 3
> So it thinks you have four --sc options and only the last is kept.
I'll note that this (which was commented in the script):
zparseopts -D -E -A elkfloats - -sc: -sc1: -sc2: -sc3:
does the expected thing, so I suspect your awk expression to generate
the ${floats} array simply needs to sort its output differently so
that "-sc:" is appears earlier in the array than "-sc1:" etc.
prev parent reply other threads:[~2021-10-28 0:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-02 18:26 Roger Mason
2021-10-27 21:22 ` Oliver Kiddle
2021-10-28 0:05 ` Bart Schaefer [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='CAH+w=7ZumMMEm=DfL22UgG9o4yJC5T-mz0OC5tR6Tfa=KHbM9Q@mail.gmail.com' \
--to=schaefer@brasslantern.com \
--cc=opk@zsh.org \
--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).