#compdef uu-rmdir

autoload -U is-at-least

_uu-rmdir() {
    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[@]}" : \
'--ignore-fail-on-non-empty[ignore each failure that is solely because a directory is non-empty]' \
'-p[remove DIRECTORY and its ancestors; e.g., '\''rmdir -p a/b/c'\'' is similar to rmdir a/b/c a/b a]' \
'--parents[remove DIRECTORY and its ancestors; e.g., '\''rmdir -p a/b/c'\'' is similar to rmdir a/b/c a/b a]' \
'-v[output a diagnostic for every directory processed]' \
'--verbose[output a diagnostic for every directory processed]' \
'-h[Print help]' \
'--help[Print help]' \
'-V[Print version]' \
'--version[Print version]' \
'*::dirs:_files -/' \
&& ret=0
}

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

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