#compdef uu-ln

autoload -U is-at-least

_uu-ln() {
    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[@]}" \
'--backup=[make a backup of each existing destination file]:CONTROL: ' \
'-S+[override the usual backup suffix]:SUFFIX: ' \
'--suffix=[override the usual backup suffix]:SUFFIX: ' \
'(-T --no-target-directory)-t+[specify the DIRECTORY in which to create the links]:DIRECTORY:_files -/' \
'(-T --no-target-directory)--target-directory=[specify the DIRECTORY in which to create the links]:DIRECTORY:_files -/' \
'-h[Print help information]' \
'--help[Print help information]' \
'-V[Print version information]' \
'--version[Print version information]' \
'-b[like --backup but does not accept an argument]' \
'-f[remove existing destination files]' \
'--force[remove existing destination files]' \
'-i[prompt whether to remove existing destination files]' \
'--interactive[prompt whether to remove existing destination files]' \
'-n[treat LINK_NAME as a normal file if it is a symbolic link to a directory]' \
'--no-dereference[treat LINK_NAME as a normal file if it is a symbolic link to a directory]' \
'-L[dereference TARGETs that are symbolic links]' \
'--logical[dereference TARGETs that are symbolic links]' \
'-P[make hard links directly to symbolic links]' \
'--physical[make hard links directly to symbolic links]' \
'-s[make symbolic links instead of hard links]' \
'--symbolic[make symbolic links instead of hard links]' \
'-T[treat LINK_NAME as a normal file always]' \
'--no-target-directory[treat LINK_NAME as a normal file always]' \
'-r[create symbolic links relative to link location]' \
'--relative[create symbolic links relative to link location]' \
'-v[print name of each linked file]' \
'--verbose[print name of each linked file]' \
'*::files:_files' \
&& ret=0
}

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

_uu-ln "$@"
