[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 1.3-397-g525d6e7

Ville Skyttä ville.skytta at iki.fi
Thu Jul 7 21:36:54 UTC 2011


The following commit has been merged in the master branch:
commit 525d6e77ba1fe30e58761cee6aa1b88978a8f77d
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Fri Jul 8 00:34:57 2011 +0300

    Provide profile.d hook for per user disabling of bash_completion (Debian: #593835).

diff --git a/README b/README
index 67b79be..d921e2d 100644
--- a/README
+++ b/README
@@ -29,6 +29,14 @@ mechanism, i.e. does not automatically source shell scripts in it, you
 can source the $sysconfdir/profile.d/bash_completion.sh script in
 /etc/bashrc or ~/.bashrc.
 
+The profile.d script provides a configuration file hook that can be
+used to prevent loading bash_completion on per user basis when it's
+installed system wide.  To do this, turn off programmable completion
+with "shopt -u progcomp" in $XDG_CONFIG_HOME/bash_completion
+(~/.config/bash_completion if $XDG_CONFIG_HOME is not set), and turn
+it back on for example in ~/.bashrc if you want to use programmable
+completion for other purposes.
+
 If you're using MacOS X, /etc/bashrc is apparently not sourced at all.
 In that case, you can put the bash_completion file in /sw/etc and add
 the following code to ~/.bash_profile:
diff --git a/bash_completion.sh.in b/bash_completion.sh.in
index a24f850..2fb7462 100644
--- a/bash_completion.sh.in
+++ b/bash_completion.sh.in
@@ -4,6 +4,8 @@
 # Check for recent enough version of bash.
 bash=${BASH_VERSION%.*}; bmajor=${bash%.*}; bminor=${bash#*.}
 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.
         . @pkgdatadir@/bash_completion

-- 
bash-completion



More information about the Bash-completion-commits mailing list