OSDN Git Service

completion: teach replace to complete options
authorCornelius Weig <cornelius.weig@tngtech.com>
Fri, 3 Feb 2017 11:01:57 +0000 (12:01 +0100)
committerJunio C Hamano <gitster@pobox.com>
Sat, 4 Feb 2017 06:25:46 +0000 (22:25 -0800)
Git-replace needs to complete references and its own options. In
addition to the existing references completions, do also complete the
options --edit --graft --format= --list --delete.

Signed-off-by: Cornelius Weig <cornelius.weig@tngtech.com>
Reviewed-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/completion/git-completion.bash

index 2ed0ef6..8c6736e 100644 (file)
@@ -2408,6 +2408,12 @@ _git_remote ()
 
 _git_replace ()
 {
+       case "$cur" in
+       --*)
+               __gitcomp "--edit --graft --format= --list --delete"
+               return
+               ;;
+       esac
        __gitcomp_nl "$(__git_refs)"
 }