threads / patch / 12542

patchbash: Add more long options to be completed with "git --<TAB>"

Subject: [PATCH] bash: Add more long options to be completed with "git --<TAB>"

## tl;dr

One message between Mar 6, 2008 and Mar 6, 2008. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

Teemu Likonen· Mar 6, 2008, 16:52 UTC · lore
Add the following long options to be completed with command "git":
	--paginate
	--work-tree=
	--help
Signed-off-by: Teemu Likonen <tlikonen@iki.fi>
---

I'm not at all expert in bash completion code but this seems to work and can be useful.

 contrib/completion/git-completion.bash |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
Show changes to contrib/completion/git-completion.bash +3 −0
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 49e6df0..1198547 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1194,11 +1194,14 @@ _git ()
 		case "${COMP_WORDS[COMP_CWORD]}" in
 		--*=*) COMPREPLY=() ;;
 		--*)   __gitcomp "
+			--paginate
 			--no-pager
 			--git-dir=
 			--bare
 			--version
 			--exec-path
+			--work-tree=
+			--help
 			"
 			;;
 		*)     __gitcomp "$(__git_commands) $(__git_aliases)" ;;
-- 
1.5.4.3.451.g43956

← back to recent threads