mirror of
https://github.com/git/git
synced 2024-08-27 11:39:22 +00:00
completion: use __gitcomp_builtin in _git_grep
The new completable options are: --after-context= --before-context= --color --context --exclude-standard --quiet --recurse-submodules --textconv Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
7e1eeaa431
commit
caf2de3390
|
@ -832,8 +832,9 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
|
||||||
OPT_BOOL('L', "files-without-match",
|
OPT_BOOL('L', "files-without-match",
|
||||||
&opt.unmatch_name_only,
|
&opt.unmatch_name_only,
|
||||||
N_("show only the names of files without match")),
|
N_("show only the names of files without match")),
|
||||||
OPT_BOOL('z', "null", &opt.null_following_name,
|
OPT_BOOL_F('z', "null", &opt.null_following_name,
|
||||||
N_("print NUL after filenames")),
|
N_("print NUL after filenames"),
|
||||||
|
PARSE_OPT_NOCOMPLETE),
|
||||||
OPT_BOOL('c', "count", &opt.count,
|
OPT_BOOL('c', "count", &opt.count,
|
||||||
N_("show the number of matches instead of matching lines")),
|
N_("show the number of matches instead of matching lines")),
|
||||||
OPT__COLOR(&opt.color, N_("highlight matches")),
|
OPT__COLOR(&opt.color, N_("highlight matches")),
|
||||||
|
@ -884,9 +885,11 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
|
||||||
OPT_GROUP(""),
|
OPT_GROUP(""),
|
||||||
{ OPTION_STRING, 'O', "open-files-in-pager", &show_in_pager,
|
{ OPTION_STRING, 'O', "open-files-in-pager", &show_in_pager,
|
||||||
N_("pager"), N_("show matching files in the pager"),
|
N_("pager"), N_("show matching files in the pager"),
|
||||||
PARSE_OPT_OPTARG, NULL, (intptr_t)default_pager },
|
PARSE_OPT_OPTARG | PARSE_OPT_NOCOMPLETE,
|
||||||
OPT_BOOL(0, "ext-grep", &external_grep_allowed__ignored,
|
NULL, (intptr_t)default_pager },
|
||||||
N_("allow calling of grep(1) (ignored by this build)")),
|
OPT_BOOL_F(0, "ext-grep", &external_grep_allowed__ignored,
|
||||||
|
N_("allow calling of grep(1) (ignored by this build)"),
|
||||||
|
PARSE_OPT_NOCOMPLETE),
|
||||||
OPT_END()
|
OPT_END()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1565,21 +1565,7 @@ _git_grep ()
|
||||||
|
|
||||||
case "$cur" in
|
case "$cur" in
|
||||||
--*)
|
--*)
|
||||||
__gitcomp "
|
__gitcomp_builtin grep
|
||||||
--cached
|
|
||||||
--text --ignore-case --word-regexp --invert-match
|
|
||||||
--full-name --line-number
|
|
||||||
--extended-regexp --basic-regexp --fixed-strings
|
|
||||||
--perl-regexp
|
|
||||||
--threads
|
|
||||||
--files-with-matches --name-only
|
|
||||||
--files-without-match
|
|
||||||
--max-depth
|
|
||||||
--count
|
|
||||||
--and --or --not --all-match
|
|
||||||
--break --heading --show-function --function-context
|
|
||||||
--untracked --no-index
|
|
||||||
"
|
|
||||||
return
|
return
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
Loading…
Reference in a new issue