Skip to content

Commit

Permalink
Merge pull request #104 from mhagger/bash-complete-drop-revert
Browse files Browse the repository at this point in the history
Add bash completion for new `drop` and `revert` subcommands
  • Loading branch information
mhagger authored Sep 19, 2016
2 parents c9d52da + 9eb112f commit 666f38a
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions git-imerge.bashcomplete
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ __git_imerge_commands="\
start
merge
rebase
drop
revert
continue
finish
diagram
Expand Down Expand Up @@ -67,6 +69,13 @@ __git_imerge_merge_options="\
--manual
"

__git_imerge_drop_options="\
--help
--name
--branch
--manual
"

__git_imerge_list_options="\
--help
"
Expand Down Expand Up @@ -99,6 +108,8 @@ __git_imerge_remove_options=$__git_imerge_autofill_options

__git_imerge_rebase_options=$__git_imerge_merge_options

__git_imerge_revert_options=$__git_imerge_drop_options

__git-imerge_start_completion() {
case "$1_$cur" in
--help_|--branch_|_--branch=|--name_|_--name=)
Expand Down Expand Up @@ -179,6 +190,23 @@ __git-imerge_rebase_completion() {
__git-imerge_merge_completion $1
}

__git-imerge_drop_completion() {
case "$1_$cur" in
--help_|--branch_|_--branch=|--name_|_--name=)
return
;;
*-|*_-*?)
__gitcomp "$__git_imerge_merge_options"
return
;;
esac
__gitcomp "$(__git_imerge_branches)"
}

__git-imerge_revert_completion() {
__git-imerge_drop_completion $1
}

__git-imerge_list_completion() {
case "$1" in
--help)
Expand Down

0 comments on commit 666f38a

Please sign in to comment.