#compdef complate
autoload -U is-at-least
_complate() {
typeset -A opt_args
typeset -a _arguments_options
local ret=1
if is-at-least 5.2; then
_arguments_options=(-s -S -C)
else
_arguments_options=(-s -C)
fi
local context curcontext="$curcontext" state line
_arguments "${_arguments_options[@]}" \
'-e[enables experimental features]' \
'--experimental[enables experimental features]' \
'-h[Print help]' \
'--help[Print help]' \
'-V[Print version]' \
'--version[Print version]' \
":: :_complate_commands" \
"*::: :->complate" \
&& ret=0
case $state in
(complate)
words=($line[1] "${words[@]}")
(( CURRENT += 1 ))
curcontext="${curcontext%:*:*}:complate-command-$line[1]:"
case $line[1] in
(man)
_arguments "${_arguments_options[@]}" \
'-o+[]: : ' \
'--out=[]: : ' \
'-h[Print help]' \
'--help[Print help]' \
'-V[Print version]' \
'--version[Print version]' \
&& ret=0
;;
(autocomplete)
_arguments "${_arguments_options[@]}" \
'-o+[]: : ' \
'--out=[]: : ' \
'-s+[]: :(bash zsh fish elvish ps)' \
'--shell=[]: :(bash zsh fish elvish ps)' \
'-h[Print help]' \
'--help[Print help]' \
'-V[Print version]' \
'--version[Print version]' \
&& ret=0
;;
(init)
_arguments "${_arguments_options[@]}" \
'-h[Print help]' \
'--help[Print help]' \
'-V[Print version]' \
'--version[Print version]' \
&& ret=0
;;
(render)
_arguments "${_arguments_options[@]}" \
'-c+[The configuration file to use.]: : ' \
'--config=[The configuration file to use.]: : ' \
'-t+[Specify the template to use from the config and skip it'\''s selection.]: : ' \
'--template=[Specify the template to use from the config and skip it'\''s selection.]: : ' \
'-b+[The execution backend (cli=native-terminal, ui=ui emulator in terminal).]: :(cli)' \
'--backend=[The execution backend (cli=native-terminal, ui=ui emulator in terminal).]: :(cli)' \
'-v+[Overrides a certain value definition with a string.]: : ' \
'--value=[Overrides a certain value definition with a string.]: : ' \
'--trust[Enables the shell command execution. This is potentially insecure and should only be done for trustworthy sources.]' \
'-l[Defines that the templating is done in non-strict mode (allow missing value for variable).]' \
'--loose[Defines that the templating is done in non-strict mode (allow missing value for variable).]' \
'--helpers[Enables handlebar helpers.]' \
'-h[Print help]' \
'--help[Print help]' \
'-V[Print version]' \
'--version[Print version]' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" \
":: :_complate__help_commands" \
"*::: :->help" \
&& ret=0
case $state in
(help)
words=($line[1] "${words[@]}")
(( CURRENT += 1 ))
curcontext="${curcontext%:*:*}:complate-help-command-$line[1]:"
case $line[1] in
(man)
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
(autocomplete)
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
(init)
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
(render)
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
esac
;;
esac
;;
esac
;;
esac
}
(( $+functions[_complate_commands] )) ||
_complate_commands() {
local commands; commands=(
'man:Renders the manpages.' \
'autocomplete:Renders shell completion scripts.' \
'init:Initializes a dummy default configuration in "./.complate/config.yaml".' \
'render:Renders a template by replacing values as specified by the configuration.' \
'help:Print this message or the help of the given subcommand(s)' \
)
_describe -t commands 'complate commands' commands "$@"
}
(( $+functions[_complate__autocomplete_commands] )) ||
_complate__autocomplete_commands() {
local commands; commands=()
_describe -t commands 'complate autocomplete commands' commands "$@"
}
(( $+functions[_complate__help__autocomplete_commands] )) ||
_complate__help__autocomplete_commands() {
local commands; commands=()
_describe -t commands 'complate help autocomplete commands' commands "$@"
}
(( $+functions[_complate__help_commands] )) ||
_complate__help_commands() {
local commands; commands=(
'man:Renders the manpages.' \
'autocomplete:Renders shell completion scripts.' \
'init:Initializes a dummy default configuration in "./.complate/config.yaml".' \
'render:Renders a template by replacing values as specified by the configuration.' \
'help:Print this message or the help of the given subcommand(s)' \
)
_describe -t commands 'complate help commands' commands "$@"
}
(( $+functions[_complate__help__help_commands] )) ||
_complate__help__help_commands() {
local commands; commands=()
_describe -t commands 'complate help help commands' commands "$@"
}
(( $+functions[_complate__help__init_commands] )) ||
_complate__help__init_commands() {
local commands; commands=()
_describe -t commands 'complate help init commands' commands "$@"
}
(( $+functions[_complate__init_commands] )) ||
_complate__init_commands() {
local commands; commands=()
_describe -t commands 'complate init commands' commands "$@"
}
(( $+functions[_complate__help__man_commands] )) ||
_complate__help__man_commands() {
local commands; commands=()
_describe -t commands 'complate help man commands' commands "$@"
}
(( $+functions[_complate__man_commands] )) ||
_complate__man_commands() {
local commands; commands=()
_describe -t commands 'complate man commands' commands "$@"
}
(( $+functions[_complate__help__render_commands] )) ||
_complate__help__render_commands() {
local commands; commands=()
_describe -t commands 'complate help render commands' commands "$@"
}
(( $+functions[_complate__render_commands] )) ||
_complate__render_commands() {
local commands; commands=()
_describe -t commands 'complate render commands' commands "$@"
}
if [ "$funcstack[1]" = "_complate" ]; then
_complate "$@"
else
compdef _complate complate
fi