shitbox/pkg/usr/share/zsh/site-functions/_ln

42 lines
1.1 KiB
Plaintext

#compdef ln
autoload -U is-at-least
_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[@]}" \
'-f[remove existing destination files]' \
'--force[remove existing destination files]' \
'-s[make symbolic links instead of hard links]' \
'--symbolic[make symbolic links instead of hard links]' \
'-v[print name of each linked file]' \
'--verbose[print name of each linked file]' \
'-L[For each source_file operand that names a file of type symbolic link, create a (hard) link to the file referenced by the symbolic link.]' \
'(-L)-P[For each source_file operand that names a file of type symbolic link, create a (hard) link to the symbolic link itself.]' \
'-h[Print help]' \
'--help[Print help]' \
'-V[Print version]' \
'--version[Print version]' \
'*::file:' \
':dest:' \
&& ret=0
}
(( $+functions[_ln_commands] )) ||
_ln_commands() {
local commands; commands=()
_describe -t commands 'ln commands' commands "$@"
}
_ln "$@"