zsh-workers
 help / color / mirror / code / Atom feed
* zparseopts varieties
@ 2016-01-26  8:53 Sebastian Gniazdowski
  2016-01-27  3:00 ` Bart Schaefer
  0 siblings, 1 reply; 2+ messages in thread
From: Sebastian Gniazdowski @ 2016-01-26  8:53 UTC (permalink / raw)
  To: Zsh hackers list

Hello
Argument of -M will not be put into Mopt associative array:

% typeset -A Mopt; set -- -M arg; zparseopts -D -A Mopt "M::"; echo
${(kv)Mopt}; echo "1: $1, 2: $2"
-M
1: arg, 2:

however, when setting "-Marg" instead of "-M arg":

% typeset -A Mopt; set -- -Marg; zparseopts -D -A Mopt "M::"; echo
${(kv)Mopt}; echo "1: $1, 2: $2"
-M arg
1: , 2:

and, when making argument mandatory (with single colon in "M:"):

% typeset -A Mopt; set -- -M arg; zparseopts -D -A Mopt "M:"; echo
${(kv)Mopt}; echo "1: $1, 2: $2"
-M arg
1: , 2:


Also, double colon (optionality of argument) cannot take array name:

typeset -A Mopt; set -- -M arg; zparseopts -D "M::=Mopt"; echo
${(kv)Mopt}; echo "1: $1, 2: $2"
zsh: bad set of key/value pairs for associative array


Best regards,
Sebastian Gniazdowski


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

end of thread, other threads:[~2016-01-27  3:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-26  8:53 zparseopts varieties Sebastian Gniazdowski
2016-01-27  3:00 ` Bart Schaefer

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