diff --git a/example/cmd/_test/zsh.sh b/example/cmd/_test/zsh.sh index 44b6ce66d..b2eee982a 100644 --- a/example/cmd/_test/zsh.sh +++ b/example/cmd/_test/zsh.sh @@ -1,7 +1,7 @@ #compdef example function _example_completion { - local IFS=$'\n' local words=${words[@]:0:$CURRENT} + local IFS=$'\n' # shellcheck disable=SC2086,SC2154,SC2155 if echo ${words}"''" | xargs echo 2>/dev/null > /dev/null; then diff --git a/internal/shell/zsh/snippet.go b/internal/shell/zsh/snippet.go index 4430febdc..f2accd495 100644 --- a/internal/shell/zsh/snippet.go +++ b/internal/shell/zsh/snippet.go @@ -12,8 +12,8 @@ import ( func Snippet(cmd *cobra.Command) string { return fmt.Sprintf(`#compdef %v function _%v_completion { - local IFS=$'\n' local words=${words[@]:0:$CURRENT} + local IFS=$'\n' # shellcheck disable=SC2086,SC2154,SC2155 if echo ${words}"''" | xargs echo 2>/dev/null > /dev/null; then