summaryrefslogtreecommitdiff
path: root/bash_completion.sh.in
diff options
context:
space:
mode:
authorDavid Paleino <dapal@debian.org>2010-06-16 18:20:29 +0200
committerDavid Paleino <dapal@debian.org>2010-06-16 18:20:29 +0200
commitf9748115fb4b2950fb4df7535fb723c4affde078 (patch)
tree20875f42b219a5d56e8a7e98840f6dbced003ae0 /bash_completion.sh.in
parente5a9b6220e93ca656fd9774c6aefa78241edca6f (diff)
downloadbash-completion-f9748115fb4b2950fb4df7535fb723c4affde078.tar.gz
Imported Upstream version 1.2upstream/1.2
Diffstat (limited to 'bash_completion.sh.in')
-rw-r--r--bash_completion.sh.in12
1 files changed, 12 insertions, 0 deletions
diff --git a/bash_completion.sh.in b/bash_completion.sh.in
new file mode 100644
index 00000000..bdddeee0
--- /dev/null
+++ b/bash_completion.sh.in
@@ -0,0 +1,12 @@
+# Check for interactive bash and that we haven't already been sourced.
+[ -z "$BASH_VERSION" -o -z "$PS1" -o -n "$BASH_COMPLETION" ] && return
+
+# Check for recent enough version of bash.
+bash=${BASH_VERSION%.*}; bmajor=${bash%.*}; bminor=${bash#*.}
+if [ $bmajor -gt 3 ] || [ $bmajor -eq 3 -a $bminor -ge 2 ]; then
+ if [ -r @sysconfdir@/bash_completion ]; then
+ # Source completion code.
+ . @sysconfdir@/bash_completion
+ fi
+fi
+unset bash bmajor bminor