#compdef uu-tee

autoload -U is-at-least

_uu-tee() {
    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[@]}" : \
'--output-error=[set write error behavior]' \
'-h[Print help]' \
'--help[Print help]' \
'-a[append to the given FILEs, do not overwrite]' \
'--append[append to the given FILEs, do not overwrite]' \
'-i[ignore interrupt signals (ignored on non-Unix platforms)]' \
'--ignore-interrupts[ignore interrupt signals (ignored on non-Unix platforms)]' \
'-p[set write error behavior (ignored on non-Unix platforms)]' \
'-V[Print version]' \
'--version[Print version]' \
'::file:_files' \
&& ret=0
}

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

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