summaryrefslogtreecommitdiffstats
path: root/Completion/Unix/Command/_echo
blob: e835847c2864df6a72e9c4768f7d9a1a24b572da (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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'