cdist/completions/zsh/_cdist

78 lines
3.2 KiB
Plaintext
Raw Permalink Normal View History

2016-06-07 11:44:35 +00:00
#compdef cdist
_cdist()
{
local curcontext="$curcontext" state line
typeset -A opt_args
_arguments \
'1: :->opts_cmds'\
'*: :->opts'
case $state in
opts_cmds)
2019-09-20 05:15:37 +00:00
_arguments '1:Options and commands:(banner config install inventory preos shell -h --help -q --quiet -v --verbose -V --version)'
2016-06-07 11:44:35 +00:00
;;
*)
case $words[2] in
-*)
2017-07-20 20:04:44 +00:00
opts=(-h --help -q --quiet -v --verbose -V --version)
2016-06-07 11:44:35 +00:00
compadd "$@" -- $opts
;;
banner)
2017-07-20 20:04:44 +00:00
opts=(-h --help -q --quiet -v --verbose)
2016-06-07 11:44:35 +00:00
compadd "$@" -- $opts
;;
shell)
case $words[3] in
-s|--shell)
shells=($(grep -v '^#' /etc/shells))
compadd "$@" -- $shells
;;
*)
2017-07-20 20:04:44 +00:00
opts=(-h --help -q --quiet -v --verbose -s --shell)
2016-06-07 11:44:35 +00:00
compadd "$@" -- $opts
;;
esac
;;
2016-10-13 19:40:09 +00:00
config|install)
2017-07-20 20:04:44 +00:00
opts=(-h --help -q --quiet -v --verbose -a --all -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 -t --tag -I --inventory -A --all-tagged)
2016-06-07 11:44:35 +00:00
compadd "$@" -- $opts
;;
2017-07-20 20:04:44 +00:00
inventory)
case $words[3] in
list)
opts=(-h --help -q --quiet -v --verbose -b --beta -I --inventory -a --all -f --file -H --host-only -t --tag)
compadd "$@" -- $opts
;;
add-host)
opts=(-h --help -q --quiet -v --verbose -b --beta -I --inventory -f --file)
compadd "$@" -- $opts
;;
del-host)
opts=(-h --help -q --quiet -v --verbose -b --beta -I --inventory -a --all -f --file)
compadd "$@" -- $opts
;;
add-tag)
opts=(-h --help -q --quiet -v --verbose -b --beta -I --inventory -f --file -T --tag-file -t --taglist)
compadd "$@" -- $opts
;;
del-tag)
opts=(-h --help -q --quiet -v --verbose -b --beta -I --inventory -a --all -f --file -T --tag-file -t --taglist)
compadd "$@" -- $opts
;;
*)
cmds=(list add-host del-host add-tag del-tag)
opts=(-h --help -q --quiet -v --verbose)
compadd "$@" -- $cmds $opts
;;
esac
;;
*)
2016-06-07 11:44:35 +00:00
;;
esac
esac
}
_cdist "$@"