diff mbox series

[16/47] completion: zsh: add support for general -c opts

Message ID 20210101021622.798041-17-felipe.contreras@gmail.com (mailing list archive)
State New, archived
Headers show
Series completion: git-completion 1.3 patches | expand

Commit Message

Felipe Contreras Jan. 1, 2021, 2:15 a.m. UTC
So we can specify configurations.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 contrib/completion/git-completion.zsh | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/contrib/completion/git-completion.zsh b/contrib/completion/git-completion.zsh
index 46564126e4..6232d0a823 100644
--- a/contrib/completion/git-completion.zsh
+++ b/contrib/completion/git-completion.zsh
@@ -232,6 +232,7 @@  __git_zsh_main ()
 		'--no-replace-objects[do not use replacement refs to replace git objects]' \
 		'(- :)--help[prints the synopsis and a list of the most commonly used commands]: :->arg' \
 		'*-C[run as if git was started in the given path]: :_directories' \
+		'*-c[pass a configuration parameter to the command]: :->config' \
 		'(-): :->command' \
 		'(-)*:: :->arg' && return
 
@@ -245,6 +246,10 @@  __git_zsh_main ()
 			let _ret || break
 		done
 		;;
+	(config)
+		compset -P '*[=:]'
+		emulate ksh -c __git_complete_config_variable_name_and_value
+		;;
 	(arg)
 		local command="${words[1]}" __git_dir