Zsh completion is a rather complex beast, and I find the man-page very difficult to read, especially it's missing (simple) examples of all the various optspec forms etc. I haven't managed to find anything online myself yet so help would be most appreciated.
As an example here's what I'm struggling with at the moment, and the zshcompsys
man-page doesn't offer any clarifications. I have
#compdef mtt2
_arguments -s : \
'-h' '--help' \
'-V' '--version' \
':foobars:(foo bar baz)'
Now, when I type mtt2 <TAB>
I'm only offered foo
, bar
and baz
as completions, why not -h
, --help
, etc, as well?
What magic do I need to pass to _arguments
in order to be offered all possibilities?