summaryrefslogtreecommitdiff
path: root/bash_completion.sh.in
diff options
context:
space:
mode:
authorDavid Paleino <dapal@debian.org>2011-11-03 12:32:52 +0100
committerDavid Paleino <dapal@debian.org>2011-11-03 12:32:52 +0100
commit2c8171c38d87ddef31c92a76547d3fdf773a1337 (patch)
tree5e720d5a06ead72ed55454bf6647a712a761ed91 /bash_completion.sh.in
parent9920a8faedf704420571d8072ccab27e9dac40ba (diff)
downloadbash-completion-2c8171c38d87ddef31c92a76547d3fdf773a1337.tar.gz
Imported Upstream version 1.90upstream/1.90
Diffstat (limited to 'bash_completion.sh.in')
-rw-r--r--bash_completion.sh.in10
1 files changed, 6 insertions, 4 deletions
diff --git a/bash_completion.sh.in b/bash_completion.sh.in
index f6a983fb..2fb74625 100644
--- a/bash_completion.sh.in
+++ b/bash_completion.sh.in
@@ -1,12 +1,14 @@
# Check for interactive bash and that we haven't already been sourced.
-[ -z "$BASH_VERSION" -o -z "$PS1" -o -n "$BASH_COMPLETION" ] && return
+[ -z "$BASH_VERSION" -o -z "$PS1" -o -n "$BASH_COMPLETION_COMPAT_DIR" ] && 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 shopt -q progcomp && [ -r @sysconfdir@/bash_completion ]; then
+if [ $bmajor -gt 4 ] || [ $bmajor -eq 4 -a $bminor -ge 1 ]; then
+ [ -r "${XDG_CONFIG_HOME:-$HOME/.config}/bash_completion" ] && \
+ . "${XDG_CONFIG_HOME:-$HOME/.config}/bash_completion"
+ if shopt -q progcomp && [ -r @pkgdatadir@/bash_completion ]; then
# Source completion code.
- . @sysconfdir@/bash_completion
+ . @pkgdatadir@/bash_completion
fi
fi
unset bash bmajor bminor