mirror of
https://github.com/zsh-users/zsh-completions.git
synced 2026-09-17 16:00:19 +00:00
Ack: add --type/--notype options
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user