bash completion: Add completion for 'git grep'
Add completions for all long options specified in the docs --cached --text --ignore-case --word-regexp --invert-match --full-name --extended-regexp --basic-regexp --fixed-strings --files-with-matches --name-only --files-without-match --count --and --or --not --all-match Signed-off-by: Lee Marlow <lee.marlow@gmail.com> Acked-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Lee Marlow committed
Aug 1, 2008 at 18:56 UTC
c72e0db1ff686e93478ee21a3e80a9ca73143753
1 file changed
+24
contrib/completion/git-completion.bash
+24
@@ -791,6 +791,29 @@ _git_gc ()
791
COMPREPLY=()
792
}
793
794
+_git_grep ()
795
+{
796
+ __git_has_doubledash && return
797
+
798
+ local cur="${COMP_WORDS[COMP_CWORD]}"
799
+ case "$cur" in
800
+ --*)
801
+ __gitcomp "
802
+ --cached
803
+ --text --ignore-case --word-regexp --invert-match
804
+ --full-name
805
+ --extended-regexp --basic-regexp --fixed-strings
806
+ --files-with-matches --name-only
807
+ --files-without-match
808
+ --count
809
+ --and --or --not --all-match
810
+ "
811
+ return
812
+ ;;
813
+ esac
814
+ COMPREPLY=()
815
+}
816
+
817
_git_help ()
818
{
819
local cur="${COMP_WORDS[COMP_CWORD]}"
@@ -1482,6 +1505,7 @@ _git ()
1505
fetch) _git_fetch ;;
1506
format-patch) _git_format_patch ;;
1507
gc) _git_gc ;;
1508
+ grep) _git_grep ;;
1509
help) _git_help ;;
1510
log) _git_log ;;
1511
ls-remote) _git_ls_remote ;;