Sub-commands and sub-commands flags are not autocompleted correctly in ZSH.
This is because in the ZSH template, the argument passed to --completion-bash begins with the command name.
The issue can be reproduced in _examples/completion: running ./completion nc -- returns identical autocompletion values as the ./completion -- alone.
Incorrect invocation of --completion-bash with the command name:
Sub-commands and sub-commands flags are not autocompleted correctly in ZSH. This is because in the ZSH template, the argument passed to
--completion-bash
begins with the command name.The issue can be reproduced in
_examples/completion
: running./completion nc --
returns identical autocompletion values as the./completion --
alone.Incorrect invocation of
--completion-bash
with the command name:Fixed invocation of
--completion-bash
without the command name:This PR fixes the passed arguments by starting from the second word (just like the bash template).