Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: getopts behaviour on `-'
- X-seq: zsh-workers 17506
- From: Philip Kizer <pckizer@xxxxxxxx>
- To: zsh-workers@xxxxxxxxxx (Zsh hackers list)
- Subject: Re: getopts behaviour on `-'
- Date: Tue, 06 Aug 2002 08:33:07 -0500
- In-reply-to: Your message of "Tue, 06 Aug 2002 12:50:03 BST." <11491.1028634603@xxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- Reply-to: pckizer@xxxxxxxx
- Sender: pckizer@xxxxxxxx
Peter Stephenson <pws@xxxxxxx> wrote:
>It seems a little strange that getopts doesn't treat a `-' argument the
>same way as `--', which is what builtins do.
I know you already found that the current behaviour is consistant with
other shells, but you might want a bit more explaination as why it shouldn't
be ignored.
Note the behavior of certain commands when a lone dash is used as an
argument. As a useless example, try:
uname -a | cat -n /etc/resolv.conf - /etc/zshenv
uname -a | cat -n - /etc/resolv.conf /etc/zshenv
And see the output. '-' is traditionally synonymous with STDIN. Since
getopts exists to enable consistant option parsing, you need to be able to
use getopts to work with the same option sets you might use in the more
traditional commands.
-philip
--
Philip Kizer, Senior Lead Systems Engineer, Texas A&M University
Texas A&M CIS Operating Systems Group, Unix <pckizer@xxxxxxxx>
Messages sorted by:
Reverse Date,
Date,
Thread,
Author