Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
bash completion: Add completion for 'git grep'
author
Lee Marlow
<lee.marlow@gmail.com>
Sat, 2 Aug 2008 00:56:33 +0000
(18:56 -0600)
committer
Junio C Hamano
<gitster@pobox.com>
Tue, 5 Aug 2008 04:48:51 +0000
(21:48 -0700)
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>
contrib/completion/git-completion.bash
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
7d0b18a
)
diff --git
a/contrib/completion/git-completion.bash
b/contrib/completion/git-completion.bash
index 678a155f2e89b1a6ed376e7a5891079f4ba1bb41..253be56ae24f8656df15a2146965208ae72cf462 100755
(executable)
--- a/
contrib/completion/git-completion.bash
+++ b/
contrib/completion/git-completion.bash
@@
-791,6
+791,29
@@
_git_gc ()
COMPREPLY=()
}
COMPREPLY=()
}
+_git_grep ()
+{
+ __git_has_doubledash && return
+
+ local cur="${COMP_WORDS[COMP_CWORD]}"
+ case "$cur" in
+ --*)
+ __gitcomp "
+ --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
+ "
+ return
+ ;;
+ esac
+ COMPREPLY=()
+}
+
_git_help ()
{
local cur="${COMP_WORDS[COMP_CWORD]}"
_git_help ()
{
local cur="${COMP_WORDS[COMP_CWORD]}"
@@
-1482,6
+1505,7
@@
_git ()
fetch) _git_fetch ;;
format-patch) _git_format_patch ;;
gc) _git_gc ;;
fetch) _git_fetch ;;
format-patch) _git_format_patch ;;
gc) _git_gc ;;
+ grep) _git_grep ;;
help) _git_help ;;
log) _git_log ;;
ls-remote) _git_ls_remote ;;
help) _git_help ;;
log) _git_log ;;
ls-remote) _git_ls_remote ;;