completion: teach ls-remote to complete options
authorCornelius Weig <redacted>
Fri, 3 Feb 2017 11:01:56 +0000 (12:01 +0100)
committerJunio C Hamano <redacted>
Sat, 4 Feb 2017 06:25:46 +0000 (22:25 -0800)
ls-remote needs to complete remote names and its own options. In
addition to the existing remote name completions, do also complete
the options --heads, --tags, --refs, --get-url, and --symref.

Signed-off-by: Cornelius Weig <redacted>
Reviewed-by: SZEDER Gábor <redacted>
Signed-off-by: Junio C Hamano <redacted>
contrib/completion/git-completion.bash

index bfa3afb4c130d05744b94e9993422b2941b06d07..2ed0ef629788a9ad559dbbb0b32537365aa63d44 100644 (file)
@@ -1449,6 +1449,12 @@ _git_ls_files ()
 
 _git_ls_remote ()
 {
+       case "$cur" in
+       --*)
+               __gitcomp "--heads --tags --refs --get-url --symref"
+               return
+               ;;
+       esac
        __gitcomp_nl "$(__git_remotes)"
 }
 
git clone https://git.99rst.org/PROJECT