#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=[set the size of the output (only for SHAKE)]:BITS: ' \
'-h[Print help information]' \
'--help[Print help information]' \
'-V[Print version information]' \
'--version[Print version information]' \
'-b[read in binary mode]' \
'--binary[read in binary mode]' \
'-c[read hashsums from the FILEs and check them]' \
'--check[read hashsums from the FILEs and check them]' \
'--tag[create a BSD-style checksum]' \
'(-b --binary)-t[read in text mode (default)]' \
'(-b --binary)--text[read in text mode (default)]' \
'-q[don'\''t print OK for each successfully verified file]' \
'--quiet[don'\''t print OK for each successfully verified file]' \
'-s[don'\''t output anything, status code shows success]' \
'--status[don'\''t output anything, status code shows success]' \
'--strict[exit non-zero for improperly formatted checksum lines]' \
'-w[warn about improperly formatted checksum lines]' \
'--warn[warn about improperly formatted checksum lines]' \
'--no-names[Omits filenames in the output (option not present in GNU/Coreutils)]' \
'--md5[work with MD5]' \
'--sha1[work with SHA1]' \
'--sha224[work with SHA224]' \
'--sha256[work with SHA256]' \
'--sha384[work with SHA384]' \
'--sha512[work with SHA512]' \
'--sha3[work with SHA3]' \
'--sha3-224[work with SHA3-224]' \
'--sha3-256[work with SHA3-256]' \
'--sha3-384[work with SHA3-384]' \
'--sha3-512[work with SHA3-512]' \
'--shake128[work with SHAKE128 using BITS for the output size]' \
'--shake256[work with SHAKE256 using BITS for the output size]' \
'--b2sum[work with BLAKE2]' \
'--b3sum[work with BLAKE3]' \
'*::FILE:_files' \
&& ret=0
}

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

_uu-hashsum "$@"
