From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5115 invoked from network); 6 Aug 2002 13:33:24 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 6 Aug 2002 13:33:23 -0000 Received: (qmail 27268 invoked by alias); 6 Aug 2002 13:33:10 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 17506 Received: (qmail 27254 invoked from network); 6 Aug 2002 13:33:09 -0000 Message-Id: <200208061333.g76DX7b09302@moya.tamu.edu> From: Philip Kizer To: zsh-workers@sunsite.dk (Zsh hackers list) Subject: Re: getopts behaviour on `-' Reply-To: pckizer@tamu.edu In-reply-to: Your message of "Tue, 06 Aug 2002 12:50:03 BST." <11491.1028634603@csr.com> Date: Tue, 06 Aug 2002 08:33:07 -0500 Sender: pckizer@tamu.edu Peter Stephenson 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