@matheusbsbs / matheus-bagliano / commits / b3191ce2d5
Fork 0

bash completion: Add completion for 'git archive'

Add completions for all long options specified in the docs --format= --list --verbose --prefix= --remote= --exec= The --format= long option can be completed with available formats and the --remote= can be completed with defined remote repositories. 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>

Lee Marlow committed Aug 4, 2008 at 23:50 UTC b3191ce2d5a77c17e5a236823f2dc7393e440171
1 file changed +24
contrib/completion/git-completion.bash
+24
@@ -561,6 +561,29 @@ _git_add ()
561 COMPREPLY=()
562 }
563
564 +_git_archive ()
565 +{
566 + local cur="${COMP_WORDS[COMP_CWORD]}"
567 + case "$cur" in
568 + --format=*)
569 + __gitcomp "$(git archive --list)" "" "${cur##--format=}"
570 + return
571 + ;;
572 + --remote=*)
573 + __gitcomp "$(__git_remotes)" "" "${cur##--remote=}"
574 + return
575 + ;;
576 + --*)
577 + __gitcomp "
578 + --format= --list --verbose
579 + --prefix= --remote= --exec=
580 + "
581 + return
582 + ;;
583 + esac
584 + __git_complete_file
585 +}
586 +
587 _git_bisect ()
588 {
589 __git_has_doubledash && return
@@ -1571,6 +1594,7 @@ _git ()
1594 am) _git_am ;;
1595 add) _git_add ;;
1596 apply) _git_apply ;;
1597 + archive) _git_archive ;;
1598 bisect) _git_bisect ;;
1599 bundle) _git_bundle ;;
1600 branch) _git_branch ;;