#compdef uu-env

autoload -U is-at-least

_uu-env() {
    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[@]}" : \
'-C+[env-help-chdir]:DIR:_files -/' \
'--chdir=[env-help-chdir]:DIR:_files -/' \
'*-f+[env-help-file]:PATH:_files' \
'*--file=[env-help-file]:PATH:_files' \
'*-u+[env-help-unset]:NAME:_default' \
'*--unset=[env-help-unset]:NAME:_default' \
'-S+[env-help-split-string]:S:_default' \
'--split-string=[env-help-split-string]:S:_default' \
'-a+[env-help-argv0]:a:_default' \
'--argv0=[env-help-argv0]:a:_default' \
'*--ignore-signal=[env-help-ignore-signal]:SIG:_default' \
'-i[env-help-ignore-environment]' \
'--ignore-environment[env-help-ignore-environment]' \
'-0[env-help-null]' \
'--null[env-help-null]' \
'*-v[env-help-debug]' \
'*--debug[env-help-debug]' \
'-h[Print help]' \
'--help[Print help]' \
'-V[Print version]' \
'--version[Print version]' \
'::vars:_default' \
&& ret=0
}

(( $+functions[_uu-env_commands] )) ||
_uu-env_commands() {
    local commands; commands=()
    _describe -t commands 'uu-env commands' commands "$@"
}

if [ "$funcstack[1]" = "_uu-env" ]; then
    _uu-env "$@"
else
    compdef _uu-env uu-env
fi
