#compdef uu-basenc

autoload -U is-at-least

_uu-basenc() {
    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[@]}" : \
'-w+[wrap encoded lines after COLS character (default 76, 0 to disable wrapping)]:COLS:_default' \
'--wrap=[wrap encoded lines after COLS character (default 76, 0 to disable wrapping)]:COLS:_default' \
'-d[decode data]' \
'--decode[decode data]' \
'-i[when decoding, ignore non-alphabetic characters]' \
'--ignore-garbage[when decoding, ignore non-alphabetic characters]' \
'--base64[same as '\''base64'\'' program]' \
'--base64url[file- and url-safe base64]' \
'--base32[same as '\''base32'\'' program]' \
'--base32hex[extended hex alphabet base32]' \
'--base16[hex encoding]' \
'--base2lsbf[bit string with least significant bit (lsb) first]' \
'--base2msbf[bit string with most significant bit (msb) first]' \
'--z85[ascii85-like encoding; when encoding, input length must be a multiple of 4; when decoding, input length must be a multiple of 5]' \
'-h[Print help]' \
'--help[Print help]' \
'-V[Print version]' \
'--version[Print version]' \
'::file:_files' \
&& ret=0
}

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

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