From e4df35beff96e6dcfe168abd646f0391c3863a4c Mon Sep 17 00:00:00 2001 From: Jonhnny Weslley Date: Sat, 21 May 2011 23:05:35 -0300 Subject: [PATCH] bash completion script --- etc/bash_completion.sh | 49 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 etc/bash_completion.sh diff --git a/etc/bash_completion.sh b/etc/bash_completion.sh new file mode 100644 index 0000000..273c680 --- /dev/null +++ b/etc/bash_completion.sh @@ -0,0 +1,49 @@ +# bash completion support for git-extras. + +_git_changelog(){ + __gitcomp "--list" +} + +_git_contrib(){ + __gitcomp "$(git shortlog -s | cut -f2)" # TODO buggy if author's name contains whitespaces :( +} + +_git_count(){ + __gitcomp "--all" +} + +_git_delete_branch(){ + __gitcomp "$(__git_heads)" +} + +_git_delete_submodule(){ + __gitcomp "$(git submodule status | awk '{print $2}')" +} + +_git_delete_tag(){ + __gitcomp "$(__git_tags)" +} + +_git_extras(){ + __gitcomp "--version update" +} + +_git_graft(){ + __gitcomp "$(__git_heads)" +} + +__git_extras_workflow(){ + __gitcomp "$(__git_heads | grep ^$1/ | sed s/^$1\\///g) finish" +} + +_git_feature(){ + __git_extras_workflow "feature" +} + +_git_refactor(){ + __git_extras_workflow "refactor" +} + +_git_bug(){ + __git_extras_workflow "bug" +}