Ack: add --type/--notype options

This commit is contained in:
Julien Nicoulaud 2011-07-31 19:32:00 +02:00
parent 0535d3cd5d
commit 825c3b31d2
1 changed files with 6 additions and 2 deletions

8
_ack
View File

@ -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