summary refs log tree commit diff
path: root/Completion/Unix/Command/_cowsay
blob: 8a1b4c4c93cfd20d45667476bbf83da8f28221d9 (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
#compdef cowsay cowthink

local context state line
typeset -A opt_args

_arguments -s -S -A "-*" \
  "(H mode)-e+[specify cow's eyes]:eye string [oo]" \
  '(H)-f+[specify cowfile]:cowfile:->cowfile' \
  "(H mode)-T+[specify cow's tongue]:tongue string" \
  '(H)-W+[specify width for message word wrap]:wrap column [40]' \
  '(H)-n[no wordwrap]' \
  '*:message' \
  + 'H' \
  '(- *)-h[display usage information]' \
  '(- *)-l[list all cowfiles]' \
  + '(mode)' \
  '(H -e -T)-b[borg mode]' \
  '(H -e -T)-d[dead mode]' \
  '(H -e -T)-g[greedy mode]' \
  '(H -e -T)-p[paranoia mode]' \
  '(H -e -T)-s[stoned mode]' \
  '(H -e -T)-t[tired mode]' \
  '(H -e -T)-w[wired mode]' \
  '(H -e -T)-y[youthful mode]' && return

case "$state" in
  (cowfile)
    _wanted -C option-f-1 cowfiles expl 'cow file' compadd \
      ${=${(f)"$(_call_program cowfiles $words[1] -l)"}:#*\:} || _files -g "*.cow(-.)"
  ;;
esac