summaryrefslogtreecommitdiff
path: root/extra/source/bash-completion/bash_completion.sh
diff options
context:
space:
mode:
Diffstat (limited to 'extra/source/bash-completion/bash_completion.sh')
-rw-r--r--extra/source/bash-completion/bash_completion.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/extra/source/bash-completion/bash_completion.sh b/extra/source/bash-completion/bash_completion.sh
new file mode 100644
index 00000000..84388cb8
--- /dev/null
+++ b/extra/source/bash-completion/bash_completion.sh
@@ -0,0 +1,11 @@
+bash=${BASH_VERSION%.*}; bmajor=${bash%.*}; bminor=${bash#*.}
+if [ "$PS1" ] && [ $bmajor -eq 2 ] && [ $bminor '>' 04 ] \
+ && [ -f /etc/bash_completion ]; then # interactive shell
+ # Source completion code
+ . /etc/bash_completion
+elif [ "$PS1" ] && [ $bmajor -eq 3 ] \
+ && [ -f /etc/bash_completion ]; then # interactive shell
+ # Source completion code
+ . /etc/bash_completion
+fi
+unset bash bmajor bminor