[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 1.3-30-g14fc9f2
David Paleino
dapal at debian.org
Sun Mar 20 14:22:49 UTC 2011
The following commit has been merged in the master branch:
commit 14fc9f2965d24193655a77dbca10cad61d839336
Author: David Paleino <dapal at debian.org>
Date: Sun Mar 20 15:22:33 2011 +0100
If _filedir 'ext' returns nothing, just fallback to generic file completion. Patch by Clint Byrum (Debian: #619014, LP: #533985)
diff --git a/CHANGES b/CHANGES
index eedac4e..c1cf964 100644
--- a/CHANGES
+++ b/CHANGES
@@ -10,6 +10,10 @@ bash-completion (2.x)
[ Guillaume Rousse ]
* added puppet completion, using work from Mathieu Parent (sathieudebian.org)
+ [ David Paleino ]
+ * If _filedir 'ext' returns nothing, just fallback to generic
+ file completion. Patch by Clint Byrum (Debian: #619014, LP: #533985)
+
-- David Paleino <d.paleino at gmail.com> Sun, 06 Feb 2011 21:46:37 +0100
bash-completion (1.3)
diff --git a/bash_completion b/bash_completion
index c4ae7c9..4fc5035 100644
--- a/bash_completion
+++ b/bash_completion
@@ -659,6 +659,12 @@ _filedir()
xspec=${1:+"!*.@($1|$(printf %s $1 | tr '[:lower:]' '[:upper:]'))"}
toks=( ${toks[@]-} $( compgen -f -X "$xspec" -- $quoted) )
fi
+
+ # If the filter failed to produce anything, try without it
+ if [[ -n "$1" ]] && [[ "$1" != -d ]] && [[ ${#toks[@]} -lt 1 ]] ; then
+ toks=( ${toks[@]-} $( compgen -f -- $quoted) )
+ fi
+
[ ${#toks[@]} -ne 0 ] && _compopt_o_filenames
COMPREPLY=( "${COMPREPLY[@]}" "${toks[@]}" )
--
bash-completion
More information about the Bash-completion-commits
mailing list