[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 7e92537bad3f333e4320a5c9e4c15a53965c7cd3

Ville Skyttä ville.skytta at iki.fi
Wed Aug 12 20:49:32 UTC 2009


The following commit has been merged in the master branch:
commit 7e92537bad3f333e4320a5c9e4c15a53965c7cd3
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Wed Aug 12 23:49:27 2009 +0300

    Add $compopt (":" i.e. noop with bash < 4, "compopt" with >= 4).

diff --git a/CHANGES b/CHANGES
index 7de6a60..76a1644 100644
--- a/CHANGES
+++ b/CHANGES
@@ -99,6 +99,7 @@ bash-completion (1.x)
   * Load "modules" completion if /etc/profile.d/modules.sh exists even if
     the "module" alias has not been defined (yet).
   * Add *.ogv to xine-based players (Debian: #540033).
+  * Add $compopt (":" i.e. no-op with bash < 4, "compopt" with >= 4).
 
   [ Todd Zullinger ]
   * Make yum complete on filenames after install, deplist, update and upgrade
diff --git a/bash_completion b/bash_completion
index ab03d52..cfccabb 100644
--- a/bash_completion
+++ b/bash_completion
@@ -65,6 +65,7 @@ if [ ${BASH_VERSINFO[0]} -eq 2 ] && [[ ${BASH_VERSINFO[1]} > 04 ]] ||
 	default="-o default"
 	dirnames="-o dirnames"
 	filenames="-o filenames"
+	compopt=:
 fi
 # features supported by bash 2.05b and higher
 if [ ${BASH_VERSINFO[0]} -eq 2 ] && [[ ${BASH_VERSINFO[1]} = "05b" ]] ||
@@ -81,6 +82,7 @@ fi
 # features supported by bash 4.0 and higher
 if [ ${BASH_VERSINFO[0]} -gt 3 ]; then
 	declare -r bash4=$BASH_VERSION 2>/dev/null || :
+	compopt=compopt
 fi
 
 # Turn on extended globbing and programmable completion
@@ -1555,7 +1557,8 @@ unset i
 [ $BASH_COMPLETION != ~/.bash_completion -a -r ~/.bash_completion ] \
 	&& . ~/.bash_completion
 unset -f have
-unset UNAME USERLAND default dirnames filenames have nospace bashdefault plusdirs
+unset UNAME USERLAND default dirnames filenames have nospace bashdefault \
+	plusdirs compopt
 
 set $BASH_COMPLETION_ORIGINAL_V_VALUE
 unset BASH_COMPLETION_ORIGINAL_V_VALUE

-- 
bash-completion



More information about the Bash-completion-commits mailing list