diff options
Diffstat (limited to 'Completion/Unix/Command/_echo')
| -rw-r--r-- | Completion/Unix/Command/_echo | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/Completion/Unix/Command/_echo b/Completion/Unix/Command/_echo new file mode 100644 index 000000000..e835847c2 --- /dev/null +++ b/Completion/Unix/Command/_echo @@ -0,0 +1,32 @@ +#compdef echo gecho + +local variant +local -a args + +_pick_variant -r variant -b zsh gnu='Free Soft' $OSTYPE --version + +args=( + # these are only interpreted as options when they're the only arg + + gnu-hv + '(-)--help[display help information]' + '(-)--version[display version information]' + + other + '(gnu-hv -E)-e[interpret escape sequences]' + "(gnu-hv -e)-E[don't interpret escape sequences]" + "(gnu-hv)-n[don't output trailing newline]" +) + +case $variant in + gnu) ;; # pass + zsh|openbsd*) + args=( ${args:#(|\(*\))--*} ) + ;; + darwin*|dragonfly*|netbsd*|freebsd*) + args=( ${args:#(|\(*\))(--|-[eE]\[)*} ) + ;; + *) + args=( ) + ;; +esac + +_arguments -s -A '' : $args '*:string:_default' |
