Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: How to handle unknown options in zparseopts
On Sep 2,  6:35pm, DervishD wrote:
}
} >     zparseopts -- a::=array
} >     (( $#array == 1 )) && {
Actually I botched that.  $#array will always be 1, because the argument
(when present) is placed in the same array element as the option.  The
test should be [[ $array == -a ]].
}     set -- -a xyz
}     zparseopts -A array -- a::
} 
} Does that mean that optional arguments must ALWAYS go in the same
} word as the option?
Yes, that's what I was trying to explain.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author