bash completion: Add completion for 'git clean'
authorLee Marlow <lee.marlow@gmail.com>
Tue, 5 Aug 2008 05:50:32 +0000 (23:50 -0600)
committerJunio C Hamano <gitster@pobox.com>
Wed, 6 Aug 2008 04:21:19 +0000 (21:21 -0700)
Add completions for all long options specified in the docs
--dry-run --quiet

Signed-off-by: Lee Marlow <lee.marlow@gmail.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/completion/git-completion.bash
index 147452528312aebf5981d39c0f1b36b3baf92db2..97ece7d8e5f6a2259a030cadae3ecec85fde0ec1 100755 (executable)
@@ -667,6 +667,20 @@ _git_cherry_pick ()
        esac
 }
 
+_git_clean ()
+{
+       __git_has_doubledash && return
+
+       local cur="${COMP_WORDS[COMP_CWORD]}"
+       case "$cur" in
+       --*)
+               __gitcomp "--dry-run --quiet"
+               return
+               ;;
+       esac
+       COMPREPLY=()
+}
+
 _git_clone ()
 {
        local cur="${COMP_WORDS[COMP_CWORD]}"
@@ -1523,6 +1537,7 @@ _git ()
        checkout)    _git_checkout ;;
        cherry)      _git_cherry ;;
        cherry-pick) _git_cherry_pick ;;
+       clean)       _git_clean ;;
        clone)       _git_clone ;;
        commit)      _git_commit ;;
        config)      _git_config ;;