diff --git a/_ack b/_ack index 2edba92..a7aa02b 100644 --- a/_ack +++ b/_ack @@ -43,9 +43,12 @@ _ack() { - local curcontext="$curcontext" state line cmds ret=1 + local curcontext="$curcontext" state line cmds type_opts ret=1 + + # FIXME Somehow duplicates _ack_types + type_opts=(${${(S)${(f)${${"$(_call_program types $words[1] --help=types)"}#*--\[no\]}}#*no\]}/ ##/\[}"]") + type_opts=("--"$type_opts "--no"$type_opts) - # FIXME Add directly --type/--notype _arguments -C \ '(- 1 *)--version[Display version and copyright information.]' \ '(- 1 *)--help[Print a short help statement.]' \ @@ -101,6 +104,7 @@ _ack() { '(-v --invert-match)'{-v,--invert-match}'[Invert match: select non-matching lines.]' \ '(-w --word-regexp)'{-w,--word-regexp}'[Force PATTERN to match only whole words.]' \ '(-1)-1[Stops after reporting first match of any kind.]' \ + "$type_opts[@]" \ '1: :->patterns' \ '*: :_files' \ && ret=0