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).
This commit is contained in:
parent
ccbf141e13
commit
66d3b63915
1
CHANGES
1
CHANGES
@ -12,6 +12,7 @@ bash-completion (2.x)
|
|||||||
|
|
||||||
[ Freddy Vulto ]
|
[ Freddy Vulto ]
|
||||||
* Added _tilde(), fix ~username completion (Alioth: #312613, Debian: #587095)
|
* 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
|
-- David Paleino <d.paleino@gmail.com> Wed, 16 Jun 2010 17:53:22 +0200
|
||||||
|
|
||||||
|
@ -642,7 +642,7 @@ _filedir()
|
|||||||
toks=( ${toks[@]-} $( compgen -f -X "$xspec" -- $quoted) )
|
toks=( ${toks[@]-} $( compgen -f -X "$xspec" -- $quoted) )
|
||||||
if [ ${#toks[@]} -ne 0 ]; then
|
if [ ${#toks[@]} -ne 0 ]; then
|
||||||
# If `compopt' is available, set `-o filenames'
|
# 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;
|
# No, `compopt' isn't available;
|
||||||
# Is `-o filenames' set?
|
# Is `-o filenames' set?
|
||||||
[[ (
|
[[ (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user