cdist configuration management Latest manual: https://www.cdi.st/manual/latest/ Home page: https://www.cdi.st
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

48 lines
1.5 KiB

#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)
opts=(-h --help -d --debug -v --verbose -c --conf-dir -f --file -i --initial-manifest -n --dry-run -o --out-dir -p --parallel -s --sequential --remote-copy --remote-exec)
compadd "$@" -- $opts
;;
*)
;;
esac
esac
}
_cdist "$@"