aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/keyringer/completions/bash15
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/keyringer/completions/bash b/lib/keyringer/completions/bash
index a8fce92..4459b34 100644
--- a/lib/keyringer/completions/bash
+++ b/lib/keyringer/completions/bash
@@ -1,7 +1,12 @@
+#!bash
#
# Keyringer bash completion
#
+if [[ -n ${ZSH_VERSION-} ]]; then
+ autoload -U +X bashcompinit && bashcompinit
+fi
+
# Completion for git subcommand
_keyringer_git_complete() {
if [ -e "/etc/bash_completion.d/git" ]; then
@@ -97,11 +102,17 @@ _keyringer() {
fi
# Avoid annoying bell and extra tab
- bind 'set show-all-if-ambiguous on'
+ if [ -z "$ZSH_VERSION" ]; then
+ bind 'set show-all-if-ambiguous on'
+ fi
# Return the available options
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
- [[ $COMPREPLY == */ ]] && compopt -o nospace
+
+ if [ -z "$ZSH_VERSION" ]; then
+ [[ $COMPREPLY == */ ]] && compopt -o nospace
+ fi
+
return 0
}