#compdef uu-cksum

autoload -U is-at-least

_uu-cksum() {
    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[@]}" : \
'-a+[ck-common-help-algorithm]:ALGORITHM:(sysv bsd crc crc32b md5 sha1 sha2 sha3 blake2b sm3 sha224 sha256 sha384 sha512 blake3 shake128 shake256)' \
'--algorithm=[ck-common-help-algorithm]:ALGORITHM:(sysv bsd crc crc32b md5 sha1 sha2 sha3 blake2b sm3 sha224 sha256 sha384 sha512 blake3 shake128 shake256)' \
'-l+[ck-common-help-length]: :_default' \
'--length=[ck-common-help-length]: :_default' \
'--untagged[ck-common-help-untagged]' \
'--tag[ck-common-help-tag-default]' \
'--raw[ck-common-help-raw]' \
'-c[ck-common-help-check]' \
'--check[ck-common-help-check]' \
'-w[ck-common-help-warn]' \
'--warn[ck-common-help-warn]' \
'--status[ck-common-help-status]' \
'--quiet[ck-common-help-quiet]' \
'--ignore-missing[ck-common-help-ignore-missing]' \
'--strict[ck-common-help-strict]' \
'(--raw)--base64[ck-common-help-base64]' \
'-t[]' \
'--text[]' \
'-b[]' \
'--binary[]' \
'-z[ck-common-help-zero]' \
'--zero[ck-common-help-zero]' \
'--debug[ck-common-help-debug]' \
'-h[Print help]' \
'--help[Print help]' \
'-V[Print version]' \
'--version[Print version]' \
'::file:_files' \
&& ret=0
}

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

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