38 lines
840 B
Plaintext
38 lines
840 B
Plaintext
#compdef readlink
|
|
|
|
autoload -U is-at-least
|
|
|
|
_readlink() {
|
|
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[Canonicalize path]' \
|
|
'-c[Canonicalize path]' \
|
|
'--canonicalize[Canonicalize path]' \
|
|
'-n[Do not print the terminating newline.]' \
|
|
'--no-newline[Do not print the terminating newline.]' \
|
|
'-h[Print help]' \
|
|
'--help[Print help]' \
|
|
'-V[Print version]' \
|
|
'--version[Print version]' \
|
|
'*::path:_files' \
|
|
&& ret=0
|
|
}
|
|
|
|
(( $+functions[_readlink_commands] )) ||
|
|
_readlink_commands() {
|
|
local commands; commands=()
|
|
_describe -t commands 'readlink commands' commands "$@"
|
|
}
|
|
|
|
_readlink "$@"
|