#compdef uu-truncate

autoload -U is-at-least

_uu-truncate() {
    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[@]}" \
'-r+[base the size of each file on the size of RFILE]:RFILE:_files' \
'--reference=[base the size of each file on the size of RFILE]:RFILE:_files' \
'-s+[set or adjust the size of each file according to SIZE, which is in bytes unless --io-blocks is specified]:SIZE: ' \
'--size=[set or adjust the size of each file according to SIZE, which is in bytes unless --io-blocks is specified]:SIZE: ' \
'-o[treat SIZE as the number of I/O blocks of the file rather than bytes (NOT IMPLEMENTED)]' \
'--io-blocks[treat SIZE as the number of I/O blocks of the file rather than bytes (NOT IMPLEMENTED)]' \
'-c[do not create files that do not exist]' \
'--no-create[do not create files that do not exist]' \
'-h[Print help]' \
'--help[Print help]' \
'-V[Print version]' \
'--version[Print version]' \
':files:_files' \
&& ret=0
}

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

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