It seems that I must be using zparseopts incorrectly, because I'm not getting what the expected output is for this simple example scripts.
zparseopts seems to erroneously assume that -h and --help take an argument, even though they are declared without the :.
set -- --help --checkout foo 1 2 3 4
declare -A misc
zparseopts -E -D -K \
-A misc \
'-checkout:' \
h \
-help
for k v in ${(@kv)misc}; do
echo flag $k: $v
done
echo "argv $@"
This should print out
flag --help:
flag --checkout: foo
argv 1 2 3 4
But instead prints as if --help took an argument. Am I using the -A and associative array incorrectly?
flag --help: --checkout
flag foo:
argv: 1 2 3 4