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)
|
|
|
|
_arguments '1:Options and commands:(banner config shell -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)
|
2016-08-15 15:47:19 +00:00
|
|
|
opts=(-h --help -d --debug -v --verbose -b --enable-beta -c --conf-dir -f --file -i --initial-manifest -j --jobs -n --dry-run -o --out-dir -p --parallel -s --sequential --remote-copy --remote-exec)
|
2016-06-07 11:44:35 +00:00
|
|
|
compadd "$@" -- $opts
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
|
|
|
_cdist "$@"
|