Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
zsh[modules]/zutil: zparseopts should parse alternate long options
- X-seq: zsh-users 16999
- From: toki clover <tokiclover@xxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: zsh[modules]/zutil: zparseopts should parse alternate long options
- Date: Mon, 9 Apr 2012 14:12:50 +0000
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=hlZYqctmYlgMjJ4u6xc7/iI08csxCLJGYLyJWPbO6Ek=; b=r7mzqWR3hZhitBcJCTxuHFB7kfZDVatMfpq/yLkAIR4B8Rf/hC46l117xJhsKcqqLh +NCbWuGoqUREzYAEvwn8Mj7unkKPlgOCvlo0HkjteaJRyRvDhRG2/V3IpMcvMCJpoS2a lQspxlMabqmgIsClMRxqa8onDPZh9rI4zVyo5YinRkVUwF0lO4UV7+OAoGuxayORcQ4J vpg89uRAHItZB6lAwKlvUmObL2uSAtub2zYrahIkaYCPB5FLLOVb87kJ5GhiMdO/q/JY NVRXHzW0/QC7v6ZdTnozKj7RVImkaJOeS+23wHXRibbwpdfVviPIs8MaeqJYV1z0njpE TvAg==
- 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
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.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author