aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorLee Marlow <lee.marlow@gmail.com>2008-08-04 23:50:36 -0600
committerJunio C Hamano <gitster@pobox.com>2008-08-05 21:21:19 -0700
commitb3191ce2d5a77c17e5a236823f2dc7393e440171 (patch)
treed290e90c8c7a3cc99bd72654f817a8ba9fe3e660 /contrib
parent95d43780cff575cfffeea881464c77f84f8d7244 (diff)
downloadgit-b3191ce2d5a77c17e5a236823f2dc7393e440171.tar.gz
git-b3191ce2d5a77c17e5a236823f2dc7393e440171.tar.xz
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>
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/completion/git-completion.bash24
1 files changed, 24 insertions, 0 deletions
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 49a03c314..3209e5c4b 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -561,6 +561,29 @@ _git_add ()
COMPREPLY=()
}
+_git_archive ()
+{
+ local cur="${COMP_WORDS[COMP_CWORD]}"
+ case "$cur" in
+ --format=*)
+ __gitcomp "$(git archive --list)" "" "${cur##--format=}"
+ return
+ ;;
+ --remote=*)
+ __gitcomp "$(__git_remotes)" "" "${cur##--remote=}"
+ return
+ ;;
+ --*)
+ __gitcomp "
+ --format= --list --verbose
+ --prefix= --remote= --exec=
+ "
+ return
+ ;;
+ esac
+ __git_complete_file
+}
+
_git_bisect ()
{
__git_has_doubledash && return
@@ -1571,6 +1594,7 @@ _git ()
am) _git_am ;;
add) _git_add ;;
apply) _git_apply ;;
+ archive) _git_archive ;;
bisect) _git_bisect ;;
bundle) _git_bundle ;;
branch) _git_branch ;;