Thread (9 messages) flat view 9 messages, 2 authors, 2016-06-15
DORMANTno replies

[PATCH 2/4] completion: add completer for status

From: Ramkumar Ramachandra <hidden>
Date: 2016-06-15 22:57:57
Subsystem: the rest · Maintainer: Linus Torvalds

Helped-by: SZEDER Gábor [off-list ref]
Signed-off-by: Ramkumar Ramachandra <redacted>
---
 contrib/completion/git-completion.bash | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index b51c9e3..278018f 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1699,6 +1699,33 @@ _git_stage ()
 	_git_add
 }
 
+_git_status ()
+{
+	case "$cur" in
+	--untracked-files=*)
+		__gitcomp "no normal all" "" "${cur##--untracked-files=}"
+		return
+		;;
+	--ignore-submodules=*)
+		__gitcomp "none untracked dirty all" "" "${cur##--ignore-submodules=}"
+		return
+		;;
+	--column=*)
+		__gitcomp "always never auto column row plain dense nodense" "" "${cur##--column=}"
+		return
+		;;
+	--*)
+		__gitcomp "
+			--short --branch --long --porcelain --ignored
+			--untracked-files --ignore-submodules --column
+			--untracked-files= --ignore-submodules= --column=
+			"
+		return
+		;;
+	esac
+	__git_complete_index_file "--with-tree=HEAD --cached --others"
+}
+
 __git_config_get_set_variables ()
 {
 	local prevword word config_file= c=$cword
-- 
1.8.3.1.585.g9832cb9
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help