From: toki clover <tokiclover@gmail.com>
To: zsh-users@zsh.org
Subject: zsh[modules]/zutil: zparseopts should parse alternate long options
Date: Mon, 9 Apr 2012 14:12:50 +0000 [thread overview]
Message-ID: <CAGw_SrOBWv=s2Re8oZga=DSfqjQfEAJHXy9xfTqFzKNJuh4Z5Q@mail.gmail.com> (raw)
Hi,
zsh/zutil is handy to get a nice parse option utilities and, in fact,
I use it often in scripts which permit to limit dozen of lines to just
parse options with getopt from GNU util-linux package. And once one
get used to it, one do not want to write again and again that long:
while [[ $# >0 ]]; do
case $1 in
-o|--option) some_variable_asignement; shift;;
...
esac
done
case assignement.
Now, it would be nice if an alternate long option e.g. `-option'
instead of the GNU style `--option' would work, because in the present
day, if the first letter of a long option name is a short option name,
the long option would never be parsed as one would expect. So one
should use extra `-' hyphens to get his/her long option parsed, so to
speak, to use a la GNU style long option way.
Thanks.
next reply other threads:[~2012-04-09 14:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-09 14:12 toki clover [this message]
2012-04-09 21:42 ` Bart Schaefer
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='CAGw_SrOBWv=s2Re8oZga=DSfqjQfEAJHXy9xfTqFzKNJuh4Z5Q@mail.gmail.com' \
--to=tokiclover@gmail.com \
--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).