#compdef minijinja-cli

autoload -U is-at-least

_minijinja-cli() {
    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[@]}" : \
'--config-file=[Alternative path to the config file.]:PATH:_files' \
'-f+[The format of the input data]:FORMAT:(auto cbor ini json querystring toml yaml)' \
'--format=[The format of the input data]:FORMAT:(auto cbor ini json querystring toml yaml)' \
'-a+[Reconfigures autoescape behavior]:MODE:(auto html json none)' \
'--autoescape=[Reconfigures autoescape behavior]:MODE:(auto html json none)' \
'*-D+[Defines an input variable (key=value / key\:=json_value)]:EXPR:_default' \
'*--define=[Defines an input variable (key=value / key\:=json_value)]:EXPR:_default' \
'(--no-include)*--safe-path=[Only allow includes from this path]:PATH:_files' \
'--fuel=[Configures the maximum fuel]:AMOUNT:_default' \
'*-s+[Changes a syntax feature (feature=value) \[possible features\: block-start, block-end, variable-start, variable-end, comment-start, comment-end, line-statement-prefix, line-statement-comment\]]:PAIR:_default' \
'*--syntax=[Changes a syntax feature (feature=value) \[possible features\: block-start, block-end, variable-start, variable-end, comment-start, comment-end, line-statement-prefix, line-statement-comment\]]:PAIR:_default' \
'-t+[Render a string template]:TEMPLATE_STRING:_default' \
'--template=[Render a string template]:TEMPLATE_STRING:_default' \
'-E+[Evaluates an template expression]:EXPR:_default' \
'--expr=[Evaluates an template expression]:EXPR:_default' \
'--expr-out=[The expression output mode]:MODE:(print json json-pretty status)' \
'--dump=[Dump internals of a template]:KIND:(instructions ast tokens)' \
'-o+[Path to the output file]:FILENAME:_files' \
'--output=[Path to the output file]:FILENAME:_files' \
'--select=[Select a subset of the input data]:SELECTOR:_default' \
'--generate-completion=[Generate a completion script for the given shell]:SH:(bash elvish fig fish nushell powershell zsh)' \
'--strict[Disallow undefined variables in templates]' \
'--no-include[Disallow includes and extending]' \
'-n[Do not output a trailing newline]' \
'--no-newline[Do not output a trailing newline]' \
'--trim-blocks[Enable the trim-blocks flag]' \
'--lstrip-blocks[Enable the lstrip-blocks flag]' \
'--py-compat[Enables improved Python compatibility]' \
'--env[Pass environment variables as ENV to the template]' \
'(-E --expr -t --template)--repl[Starts the repl with the given data]' \
'--print-config[Print out the loaded config]' \
'-h[Print short help (short texts)]' \
'--help[Print short help (short texts)]' \
'--long-help[Print long help (extended, long explanation texts)]' \
'--syntax-help[Print syntax help (primer on Jinja2/MiniJinja syntax)]' \
'-V[Print version]' \
'--version[Print version]' \
'::template_file -- Path to the input template:_default' \
'*::data_file -- Path to one or more data files used as template context:_files' \
&& ret=0
}

(( $+functions[_minijinja-cli_commands] )) ||
_minijinja-cli_commands() {
    local commands; commands=()
    _describe -t commands 'minijinja-cli commands' commands "$@"
}

if [ "$funcstack[1]" = "_minijinja-cli" ]; then
    _minijinja-cli "$@"
else
    compdef _minijinja-cli minijinja-cli
fi
