32 lines
677 B
Plaintext
32 lines
677 B
Plaintext
|
#compdef echo
|
||
|
|
||
|
autoload -U is-at-least
|
||
|
|
||
|
_echo() {
|
||
|
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[@]}" \
|
||
|
'-n+[Do not output a trailing newline]: : ' \
|
||
|
'-h[Print help (see more with '\''--help'\'')]' \
|
||
|
'--help[Print help (see more with '\''--help'\'')]' \
|
||
|
'*::STRING:' \
|
||
|
&& ret=0
|
||
|
}
|
||
|
|
||
|
(( $+functions[_echo_commands] )) ||
|
||
|
_echo_commands() {
|
||
|
local commands; commands=()
|
||
|
_describe -t commands 'echo commands' commands "$@"
|
||
|
}
|
||
|
|
||
|
_echo "$@"
|