Properly detect Zsh shell

There is no need to define custom shell var, when Zsh can be detected by
checking SHELL env var.
This commit is contained in:
Ihor Urazov
2021-01-29 17:04:54 +02:00
committed by Dan Buch
parent f89647bd19
commit 1150c2e180
4 changed files with 8 additions and 9 deletions

View File

@@ -4,9 +4,9 @@ local -a opts
local cur
cur=${words[-1]}
if [[ "$cur" == "-"* ]]; then
opts=("${(@f)$(_CLI_ZSH_AUTOCOMPLETE_HACK=1 ${words[@]:0:#words[@]-1} ${cur} --generate-bash-completion)}")
opts=("${(@f)$(${words[@]:0:#words[@]-1} ${cur} --generate-bash-completion)}")
else
opts=("${(@f)$(_CLI_ZSH_AUTOCOMPLETE_HACK=1 ${words[@]:0:#words[@]-1} --generate-bash-completion)}")
opts=("${(@f)$(${words[@]:0:#words[@]-1} --generate-bash-completion)}")
fi
if [[ "${opts[1]}" != "" ]]; then