#compdef uu-cut

autoload -U is-at-least

_uu-cut() {
    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[@]}" : \
'*-b+[cut-help-bytes]:LIST:_default' \
'*--bytes=[cut-help-bytes]:LIST:_default' \
'*-c+[cut-help-characters]:LIST:_default' \
'*--characters=[cut-help-characters]:LIST:_default' \
'-d+[cut-help-delimiter]:DELIM:_default' \
'--delimiter=[cut-help-delimiter]:DELIM:_default' \
'*-f+[cut-help-fields]:LIST:_default' \
'*--fields=[cut-help-fields]:LIST:_default' \
'--output-delimiter=[cut-help-output-delimiter]:NEW_DELIM:_default' \
'-w[cut-help-whitespace-delimited]' \
'--complement[cut-help-complement]' \
'-s[cut-help-only-delimited]' \
'--only-delimited[cut-help-only-delimited]' \
'-z[cut-help-zero-terminated]' \
'--zero-terminated[cut-help-zero-terminated]' \
'-h[Print help]' \
'--help[Print help]' \
'-V[Print version]' \
'--version[Print version]' \
'::file:_files' \
&& ret=0
}

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

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