zsh-completion: Add missing flag to compadd

This fixes an issue with zsh completion where certain words were not added to the
list of matches, but incorrectly interpreted as flags or options.

By passing the "--" flag, compadd is notified that all following arguments should
be considered for completion and not interpreted as flags or options for compadd.

Details can be found in the compadd documentation:
http://zsh.sourceforge.net/Doc/Release/Completion-Widgets.html#Completion-Builtin-Commands

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
This commit is contained in:
Christian Ebner 2020-02-20 16:33:07 +01:00 committed by Thomas Lamprecht
parent a70e9925ae
commit 630fe0a735

View File

@ -519,7 +519,7 @@ function _$exename() {
cmd=\${words[1]}
curr=\${words[cwords]}
prev=\${words[cwords-1]}
compadd \$(COMP_CWORD="\$cwords" COMP_LINE="\$line" COMP_POINT="\$point" \\
compadd -- \$(COMP_CWORD="\$cwords" COMP_LINE="\$line" COMP_POINT="\$point" \\
$exename bashcomplete "\$cmd" "\$curr" "\$prev")
}
__EOD__