Zsh completion resource? -


Zsh completion is a complex complex animal, and I find it very difficult to read man pages, especially this (simple) all Examples of various optspec forms etc. I have not managed to find myself online, but so far it will be most appreciated.

For example, I am struggling with this time, and the zshcompsys man page does not offer any explanation I have

  #compdef mtt2 _arguments -s: \ '-h' '--help' \ '-V' '--version' \ ': foobors: (foo bar bottom)'  

Now, when I type mtt2 & lt; TAB & gt; Only me foo , bar and baz as a form of completion, why not -h , < Code> - help , etc., as well?

There is a need to start a debate that you complete with a dash (I mean the argument that you type to type, not the _arguments argument). You should see either zstyle , try passing -h and other such as : foobars: or even directly < Use code> compadd code . Example:

  1. Use Compound:
     #compdef test A = (-H --help -V -version foo bar baz) compadd -a a 
  2. Passing -h and other just like : foobars: :
     #compdef test A = (-h --help -V --version) _arguments \ - foobars \ ': foobars: (foo bar falcon)' \ - option \ ": logic: ($ A)" 
    or
     a = (-h --help -v --version foo bar Baz) _arguments \ "::: ($ A)" 
  3. zstyle The full style of control described it in the «COMPLETION SYSTEM CONFIGURATION» section in man zshcompsys < / Code> and possibly an option that will be able to complete the switch, take The following does not know which option to control me.