cdist/completions/zsh/_cdist

49 lines
1.6 KiB
Plaintext

#compdef cdist
_cdist()
{
local curcontext="$curcontext" state line
typeset -A opt_args
_arguments \
'1: :->opts_cmds'\
'*: :->opts'
case $state in
opts_cmds)
_arguments '1:Options and commands:(banner config shell install -h --help -d --debug -v --verbose -V --version)'
;;
*)
case $words[2] in
-*)
opts=(-h --help -d --debug -v --verbose -V --version)
compadd "$@" -- $opts
;;
banner)
opts=(-h --help -d --debug -v --verbose)
compadd "$@" -- $opts
;;
shell)
case $words[3] in
-s|--shell)
shells=($(grep -v '^#' /etc/shells))
compadd "$@" -- $shells
;;
*)
opts=(-h --help -d --debug -v --verbose -s --shell)
compadd "$@" -- $opts
;;
esac
;;
config|install)
opts=(-h --help -d --debug -v --verbose -b --beta -C --cache-path-pattern -c --conf-dir -f --file -i --initial-manifest -j --jobs -n --dry-run -o --out-dir -p --parallel -r --remote-out-dir -s --sequential --remote-copy --remote-exec)
compadd "$@" -- $opts
;;
*)
;;
esac
esac
}
_cdist "$@"