#compdef uu-unexpand

autoload -U is-at-least

_uu-unexpand() {
    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[@]}" : \
'*-t+[use comma separated LIST of tab positions or have tabs N characters apart instead of 8 (enables -a)]:N, LIST:_default' \
'*--tabs=[use comma separated LIST of tab positions or have tabs N characters apart instead of 8 (enables -a)]:N, LIST:_default' \
'-a[convert all blanks, instead of just initial blanks]' \
'--all[convert all blanks, instead of just initial blanks]' \
'-f[convert only leading sequences of blanks (overrides -a)]' \
'--first-only[convert only leading sequences of blanks (overrides -a)]' \
'-U[interpret input file as 8-bit ASCII rather than UTF-8]' \
'--no-utf8[interpret input file as 8-bit ASCII rather than UTF-8]' \
'-h[Print help]' \
'--help[Print help]' \
'-V[Print version]' \
'--version[Print version]' \
'::file:_files' \
&& ret=0
}

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

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