#compdef uu-touch

autoload -U is-at-least

_uu-touch() {
    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[@]}" \
'-t+[use \[\[CC\]YY\]MMDDhhmm\[.ss\] instead of the current time]:STAMP: ' \
'(-t)-d+[parse argument and use it instead of current time]:STRING: ' \
'(-t)--date=[parse argument and use it instead of current time]:STRING: ' \
'(-t)-r+[use this file'\''s times instead of the current time]:FILE:_files' \
'(-t)--reference=[use this file'\''s times instead of the current time]:FILE:_files' \
'--time=[change only the specified time\: "access", "atime", or "use" are equivalent to -a; "modify" or "mtime" are equivalent to -m]:WORD:(atime mtime)' \
'--help[Print help information.]' \
'-a[change only the access time]' \
'-m[change only the modification time]' \
'-c[do not create any files]' \
'--no-create[do not create any files]' \
'-h[affect each symbolic link instead of any referenced file (only for systems that can change the timestamps of a symlink)]' \
'--no-dereference[affect each symbolic link instead of any referenced file (only for systems that can change the timestamps of a symlink)]' \
'-V[Print version]' \
'--version[Print version]' \
'*::files:_files' \
&& ret=0
}

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

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