urfave-cli/autocomplete/zsh_autocomplete

17 lines
328 B
Plaintext
Raw Normal View History

2019-10-06 08:58:51 +00:00
#compdef $PROG
local -a opts
local cur
cur=${words[-1]}
if [[ "$cur" == "-"* ]]; then
opts=("${(@f)$(${words[@]:0:#words[@]-1} ${cur} --generate-bash-completion)}")
else
opts=("${(@f)$(${words[@]:0:#words[@]-1} --generate-bash-completion)}")
fi
2014-06-18 15:59:07 +00:00
if [[ "${opts[1]}" != "" ]]; then
_describe 'values' opts
else
_files
fi