Skip to content

Commit

Permalink
Make BASH completion working for git-elegant file
Browse files Browse the repository at this point in the history
A user may invoke `git elegant` as well as `git-elegant`. And we have to
provide BASH completion in both cases. That's why the completion
function is now registered for `git-elegant` name. And it works for `git
elegant` also.

#205
  • Loading branch information
extsoft committed Oct 8, 2019
1 parent 83d2e81 commit 2c31b85
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion completions/git-elegant.bash
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ _git_elegant() {
prev="${COMP_WORDS[COMP_CWORD-1]}"

case "${prev}" in
elegant)
elegant|git-elegant)
opts=($(git elegant commands))
COMPREPLY=( $(compgen -W "${opts[*]}" -- ${cur}) )
return 0 ;;
Expand All @@ -24,3 +24,5 @@ _git_elegant() {
return 0 ;;
esac
}

complete -F _git_elegant git-elegant

0 comments on commit 2c31b85

Please sign in to comment.