From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 535 invoked from network); 30 Dec 1996 12:55:25 -0000 Received: from euclid.skiles.gatech.edu (list@130.207.146.50) by coral.primenet.com.au with SMTP; 30 Dec 1996 12:55:25 -0000 Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id HAA21186; Mon, 30 Dec 1996 07:58:24 -0500 (EST) Resent-Date: Mon, 30 Dec 1996 07:58:24 -0500 (EST) Message-Id: <199612301259.MAA03125@picasso.cs.tcd.ie> To: zsh-workers@math.gatech.edu Subject: Anomaly in "getopts" in 3.1.0 (possibly earlier) X-Uri: http://isg.cs.tcd.ie/cbuckley/ Date: Mon, 30 Dec 1996 12:59:14 +0000 From: Colm Buckley Resent-Message-ID: <"P7nf31.0.wA5.lnxno"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/2672 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu Hi all - I don't know if this has been pointed out before, but 3.1.0 is exhibiting slightly anomalous behaviour in "getopts". It seems that a leading "+" sign is ignored for the last option in the list, if further arguments follow - the following should demonstrate the problem... vangogh % cat test.zsh #!/usr/local/bin/zsh # Test script to demonstrate "getopts" while getopts ":abc" opt ; do echo "Option is : $opt" done shift ((--OPTIND)) echo Remaining arguments are : $@ vangogh % test.zsh +a Option is : +a Remaining arguments are : vangogh % test.zsh +ab Option is : +a Option is : +b Remaining arguments are : vangogh % test.zsh +a +b Option is : +a Option is : +b Remaining arguments are : vangogh % test.zsh +a hello Option is : a Remaining arguments are : hello vangogh % test.zsh +ab hello Option is : +a Option is : b Remaining arguments are : hello vangogh % test.zsh +a +b hello Option is : +a Option is : b Remaining arguments are : hello Notice that the '+' is removed from the final option, when there are following arguments... I don't think that this is the correct behaviour. Colm -- Colm Buckley B.F. | EMail : Colm.Buckley@tcd.ie or colm@lspace.org Computer Science | WWW : http://isg.cs.tcd.ie/cbuckley/ Trinity College | Phone : +353 87 469146 (087-469146 within Ireland) Dublin 2, Ireland | "Microsoft : Where do you want to crash today?"