diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2013-09-27 19:20:08 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2013-09-27 19:20:08 -0300 |
commit | de41af4df36193fb9df4b211243dc07b98156807 (patch) | |
tree | 7f18e2293303512606bd5f513cf80a2549f61612 /lib | |
parent | 06cb5c8c45abd9da0dc9860c9a7fe62f74ca509b (diff) | |
download | keyringer-de41af4df36193fb9df4b211243dc07b98156807.tar.gz keyringer-de41af4df36193fb9df4b211243dc07b98156807.tar.bz2 |
Support git completion found also at /usr/share
Diffstat (limited to 'lib')
-rw-r--r-- | lib/keyringer/completions/bash/keyringer | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/keyringer/completions/bash/keyringer b/lib/keyringer/completions/bash/keyringer index 3d519c9..936e5e0 100644 --- a/lib/keyringer/completions/bash/keyringer +++ b/lib/keyringer/completions/bash/keyringer @@ -9,9 +9,17 @@ fi # Completion for git subcommand _keyringer_git_complete() { + local git_completion="" + if [ -e "/etc/bash_completion.d/git" ]; then + git_completion="/etc/bash_completion.d/git" + elif [ -e "/usr/share/bash-completion/completions/git" ]; then + git_completion="/usr/share/bash-completion/completions/git" + fi + + if [ ! -z "$git_completion" ]; then ( - source /etc/bash_completion.d/git + source $git_completion cd $path COMP_WORDS=(git $*) COMP_CWORD=$((${#COMP_WORDS[*]} - 1)) |