git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] completion: complete config variables for --get/getall/unset/unset-all
@ 2009-05-07  6:15 Stephen Boyd
  2009-05-07  6:15 ` [PATCH 2/3] completion: add find_argument_and_value() function Stephen Boyd
  2009-05-07  6:18 ` Stephen Boyd
  0 siblings, 2 replies; 7+ messages in thread
From: Stephen Boyd @ 2009-05-07  6:15 UTC (permalink / raw)
  To: Shawn O. Pearce; +Cc: git

This should make it easier for users to get and unset their
configuration variables without having to open documentation or dig
through their configuration file.

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
---
 contrib/completion/git-completion.bash |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 1683e6d..72a16a1 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1322,6 +1322,17 @@ _git_send_email ()
 	COMPREPLY=()
 }
 
+__git_config_get_set_variables ()
+{
+	for i in $(git --git-dir="$(__gitdir)" config --list); do
+		case "$i" in
+		*.*)
+			echo "${i/=*/}"
+			;;
+		esac
+	done
+}
+
 _git_config ()
 {
 	local cur="${COMP_WORDS[COMP_CWORD]}"
@@ -1388,6 +1399,10 @@ _git_config ()
 		__gitcomp "$__git_send_email_suppresscc_options"
 		return
 		;;
+	--get|--get-all|--unset|--unset-all)
+		__gitcomp "$(__git_config_get_set_variables)"
+		return
+		;;
 	*.*)
 		COMPREPLY=()
 		return
-- 
1.6.3.rc4.29.g8146

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-05-09  1:01 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-07  6:15 [PATCH 1/3] completion: complete config variables for --get/getall/unset/unset-all Stephen Boyd
2009-05-07  6:15 ` [PATCH 2/3] completion: add find_argument_and_value() function Stephen Boyd
2009-05-07  6:18 ` Stephen Boyd
2009-05-07  6:18   ` [PATCH 3/3] completion: use specified file (if any) when completing config vars Stephen Boyd
2009-05-07 15:12     ` Shawn O. Pearce
2009-05-07 19:55       ` Stephen Boyd
2009-05-09  1:00         ` Stephen Boyd

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).