From 47025841275ac9c831e3d2707d77787367cbccab Mon Sep 17 00:00:00 2001 From: Grzegorz Zdunek Date: Fri, 12 May 2023 17:17:13 +0200 Subject: [PATCH] Do not pass command name to `--completion-bash` arguments in ZSH template --- templates.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates.go b/templates.go index 9694046..703c2cd 100644 --- a/templates.go +++ b/templates.go @@ -248,7 +248,7 @@ complete -F _{{.App.Name}}_bash_autocomplete -o default {{.App.Name}} var ZshCompletionTemplate = `#compdef {{.App.Name}} _{{.App.Name}}() { - local matches=($(${words[1]} --completion-bash "${(@)words[1,$CURRENT]}")) + local matches=($(${words[1]} --completion-bash "${(@)words[2,$CURRENT]}")) compadd -a matches if [[ $compstate[nmatches] -eq 0 && $words[$CURRENT] != -* ]]; then