Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
zparseopts varieties
- X-seq: zsh-workers 37789
- From: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: zparseopts varieties
- Date: Tue, 26 Jan 2016 09:53:04 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=+usHF0WkUgD6v6xE0kwCJhRhn05ntREsqHyaGsjEvqc=; b=dRoNRwkAJnHU5i47b2tb8Ft8VsFyPtboAGE9bOU8pF+F4jWZ1cAoejwKa69XM1bTL7 g6uMUmB/RLIopZxjzXD9x/nGpleLzz8AkFXhE2CW5UR98vf6NdQGbkLLDE+LXo97E9np L5rfzB8gDs7eNB5SBT1ojgWBX0TPuoxTtEsssoHaRKn6SKiWCYC/tBfaGBMC0lxIGXc5 QEAfo4dd6CROXTEMamkEpi+Inn2eXBYJpKM1w/TlD2KoK8FB1vkHO1cX45cSiV90F9yP /f8u7BVwtlr3tkkn5DAMqL7iWzZAp6Js08dAU0uS5ZsASNur0HMI2K8TxueFxez4LU7B GkMA==
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author