zsh-workers
 help / color / mirror / code / Atom feed
* getopts broken in 3.0.2
@ 1997-01-28 19:12 blaise
  0 siblings, 0 replies; 3+ messages in thread
From: blaise @ 1997-01-28 19:12 UTC (permalink / raw)
  To: zsh-workers

getopts seems to be broken in 3.0.2 and above (it's ok in 3.0.1)
It appears that if one of the options require a parameter, then all
the other options will now expect one too.

Consider the following script:

/tmp/aa:
--------8<------------------------------
while getopts a:b OPTION
do
    echo "OPTION is $OPTION"
done
--------8<------------------------------

sample run:

~> zsh-3.0.1 /tmp/aa -b
OPTION is b


~> zsh-3.0.2 /tmp/aa -b
/tmp/aa: argument expected after -b option [1]
OPTION is ?

-- 
Blaise Tarr
btarr@attmail.com


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: getopts broken in 3.0.2
  1997-08-26 18:33 Clint Olsen
@ 1997-08-26 19:31 ` Zoltan T. Hidvegi
  0 siblings, 0 replies; 3+ messages in thread
From: Zoltan T. Hidvegi @ 1997-08-26 19:31 UTC (permalink / raw)
  To: Clint Olsen; +Cc: zsh-workers

Clint Olsen wrote:
> Wow, I was almost deafened by the silence of my last request.  Anyway, I
> switched the shell to use "bash" and getopts works just fine there.  I
> believe we have a bug, cap'n.

getopts has been fixed in zsh-3.0.4, but if you can wait a bit with the
upgrade, you can upgrade to zsh-3.0.5 skipping zsh-3.0.4.

Zoltan


^ permalink raw reply	[flat|nested] 3+ messages in thread

* getopts broken in 3.0.2
@ 1997-08-26 18:33 Clint Olsen
  1997-08-26 19:31 ` Zoltan T. Hidvegi
  0 siblings, 1 reply; 3+ messages in thread
From: Clint Olsen @ 1997-08-26 18:33 UTC (permalink / raw)
  To: zsh-workers

Wow, I was almost deafened by the silence of my last request.  Anyway, I
switched the shell to use "bash" and getopts works just fine there.  I
believe we have a bug, cap'n.

while getopts G2rd: OPT
do
  case $OPT in
   '2'|'r'|'G') GENARG=($GENARG -$OPT) ;;
    'd') echo printer is $OPTARG ;; #LPARG=-d$OPTARG ;;
    '?') echo $0:t: Unknown option $OPTARG; exit 1 ;;
    ':') echo $0:t: Option required for $OPTARG; exit 1 ;;
  esac
done

-Clint


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1997-08-26 20:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-01-28 19:12 getopts broken in 3.0.2 blaise
1997-08-26 18:33 Clint Olsen
1997-08-26 19:31 ` Zoltan T. Hidvegi

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).