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

master
Ville Skyttä 2009-08-12 23:49:27 +03:00
parent a1f5b2e2d0
commit 7e92537bad
2 changed files with 5 additions and 1 deletions

View File

@ -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

View File

@ -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