]> git.pld-linux.org Git - packages/bash-completion.git/commitdiff
- script to load bash_completion
authorElan Ruusamäe <glen@pld-linux.org>
Wed, 1 Mar 2006 19:58:59 +0000 (19:58 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    bash-completion.sh -> 1.1

bash-completion.sh [new file with mode: 0644]

diff --git a/bash-completion.sh b/bash-completion.sh
new file mode 100644 (file)
index 0000000..f9d9a92
--- /dev/null
@@ -0,0 +1,16 @@
+# $Id$
+
+# Check for bash (and that we haven't already been sourced).
+[ -z "$BASH_VERSION" -o -n "$BASH_COMPLETION" ] && return
+
+# must be interactive shell, not script
+[[ $- = *i* ]] || return
+[ -n "$PS1" ] || return
+
+# Check for recent enough version of bash.
+bash=${BASH_VERSION%.*}; bmajor=${bash%.*}; bminor=${bash#*.}
+if [ "$bmajor" -eq 2 -a "$bminor" '>' 04 ] || [ "$bmajor" -gt 2 ]; then
+       # Source completion code
+       . /etc/bash_completion
+fi
+unset bash bminor bmajor
This page took 0.067013 seconds and 4 git commands to generate.