#compdef uu-rm

autoload -U is-at-least

_uu-rm() {
    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[@]}" \
'--interactive=[prompt according to WHEN\: never, once (-I), or always (-i). Without WHEN, prompts always]' \
'-f[ignore nonexistent files and arguments, never prompt]' \
'--force[ignore nonexistent files and arguments, never prompt]' \
'-i[prompt before every removal]' \
'-I[prompt once before removing more than three files, or when removing recursively. Less intrusive than -i, while still giving some protection against most mistakes]' \
'--one-file-system[when removing a hierarchy recursively, skip any directory that is on a file system different from that of the corresponding command line argument (NOT IMPLEMENTED)]' \
'--no-preserve-root[do not treat '\''/'\'' specially]' \
'--preserve-root[do not remove '\''/'\'' (default)]' \
'-r[remove directories and their contents recursively]' \
'-R[remove directories and their contents recursively]' \
'--recursive[remove directories and their contents recursively]' \
'-d[remove empty directories]' \
'--dir[remove empty directories]' \
'-v[explain what is being done]' \
'--verbose[explain what is being done]' \
'--presume-input-tty[]' \
'-h[Print help]' \
'--help[Print help]' \
'-V[Print version]' \
'--version[Print version]' \
'*::files:_files' \
&& ret=0
}

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

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