Speed up `compopt' availability detection.

Used `type compopt' instead of `compopt' to detect availability of
compopt because (at least on Ubuntu) a python-command-not-found handler
is started when issuing a non-existing command, thus resulting in
considerable slower completions on systems without compopt (bash < 4.0).
master
Freddy Vulto 2010-06-30 23:40:13 +02:00
parent ccbf141e13
commit 66d3b63915
2 changed files with 2 additions and 1 deletions

View File

@ -12,6 +12,7 @@ bash-completion (2.x)
[ Freddy Vulto ]
* Added _tilde(), fix ~username completion (Alioth: #312613, Debian: #587095)
* Speed up `compopt' availability detection
-- David Paleino <d.paleino@gmail.com> Wed, 16 Jun 2010 17:53:22 +0200

View File

@ -642,7 +642,7 @@ _filedir()
toks=( ${toks[@]-} $( compgen -f -X "$xspec" -- $quoted) )
if [ ${#toks[@]} -ne 0 ]; then
# If `compopt' is available, set `-o filenames'
compopt &>/dev/null && compopt -o filenames ||
type compopt &>/dev/null && compopt -o filenames ||
# No, `compopt' isn't available;
# Is `-o filenames' set?
[[ (