zsh-workers
 help / color / mirror / code / Atom feed
From: Philip Kizer <pckizer@tamu.edu>
To: zsh-workers@sunsite.dk (Zsh hackers list)
Subject: Re: getopts behaviour on `-'
Date: Tue, 06 Aug 2002 08:33:07 -0500	[thread overview]
Message-ID: <200208061333.g76DX7b09302@moya.tamu.edu> (raw)
In-Reply-To: Your message of "Tue, 06 Aug 2002 12:50:03 BST." <11491.1028634603@csr.com>

Peter Stephenson <pws@csr.com> 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@tamu.edu>


      parent reply	other threads:[~2002-08-06 13:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-08-06 11:50 Peter Stephenson
2002-08-06 12:05 ` Peter Stephenson
2002-08-06 13:33 ` Philip Kizer [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=200208061333.g76DX7b09302@moya.tamu.edu \
    --to=pckizer@tamu.edu \
    --cc=zsh-workers@sunsite.dk \
    /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).