Thread (23 messages) 23 messages, 4 authors, 2017-02-09

Re: [PATCH 4/7] completion: teach ls-remote to complete options

From: SZEDER Gábor <hidden>
Date: 2017-02-02 01:41:00

ls-remote needs to complete remote names and its own options.
And refnames, too.
In
addition to the existing remote name completions, do also complete
the options --heads, --tags, --refs, and --get-url.
Why only these four options and not the other four?

There are eight options in total here, so there is really no chance
for cluttered terminals, and all eight are mentioned in the synopsis.
quoted hunk ↗ jump to hunk
---
 contrib/completion/git-completion.bash | 6 ++++++
 1 file changed, 6 insertions(+)
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 652c7e2..36fe439 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1449,6 +1449,12 @@ _git_ls_files ()
 
 _git_ls_remote ()
 {
+	case "$cur" in
+	--*)
+		__gitcomp "--heads --tags --refs --get-url"
+		return
+		;;
+	esac
 	__gitcomp_nl "$(__git_remotes)"
 }
 
-- 
2.10.2
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help