From: Lee Marlow Date: Sat, 2 Aug 2008 00:56:33 +0000 (-0600) Subject: bash completion: Add completion for 'git grep' X-Git-Tag: v1.6.0-rc2~26 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=c72e0db1ff686e93478ee21a3e80a9ca73143753;p=git.git 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 Acked-by: Shawn O. Pearce Signed-off-by: Junio C Hamano --- diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 678a155f2..253be56ae 100755 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -791,6 +791,29 @@ _git_gc () 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]}" @@ -1482,6 +1505,7 @@ _git () 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 ;;