#compdef uu-hashsum

autoload -U is-at-least

_uu-hashsum() {
    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[@]}" : \
'--bits=[hashsum-help-bits]:BITS:_default' \
'-b[hashsum-help-binary-other]' \
'--binary[hashsum-help-binary-other]' \
'(--tag)-c[hashsum-help-check]' \
'(--tag)--check[hashsum-help-check]' \
'(-t --text)--tag[hashsum-help-tag]' \
'(-b --binary)-t[hashsum-help-text-other]' \
'(-b --binary)--text[hashsum-help-text-other]' \
'-q[hashsum-help-quiet]' \
'--quiet[hashsum-help-quiet]' \
'-s[hashsum-help-status]' \
'--status[hashsum-help-status]' \
'--strict[hashsum-help-strict]' \
'--ignore-missing[hashsum-help-ignore-missing]' \
'-w[hashsum-help-warn]' \
'--warn[hashsum-help-warn]' \
'-z[hashsum-help-zero]' \
'--zero[hashsum-help-zero]' \
'--no-names[hashsum-help-no-names]' \
'--md5[hashsum-help-md5]' \
'--sha1[hashsum-help-sha1]' \
'--sha224[hashsum-help-sha224]' \
'--sha256[hashsum-help-sha256]' \
'--sha384[hashsum-help-sha384]' \
'--sha512[hashsum-help-sha512]' \
'--sha3[hashsum-help-sha3]' \
'--sha3-224[hashsum-help-sha3-224]' \
'--sha3-256[hashsum-help-sha3-256]' \
'--sha3-384[hashsum-help-sha3-384]' \
'--sha3-512[hashsum-help-sha3-512]' \
'--shake128[hashsum-help-shake128]' \
'--shake256[hashsum-help-shake256]' \
'--b2sum[hashsum-help-b2sum]' \
'--b3sum[hashsum-help-b3sum]' \
'-h[Print help]' \
'--help[Print help]' \
'-V[Print version]' \
'--version[Print version]' \
'::file:_files' \
&& ret=0
}

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

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