Ack: add --type/--notype options
This commit is contained in:
parent
0535d3cd5d
commit
825c3b31d2
8
_ack
8
_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
|
||||
|
|
Loading…
Reference in New Issue