_filedir: bash > 4 has the same behaviour regardless of $cur beginning with ' or not
This can be triggered when $cur is actually empty, like, for example, when _filedir is manually launched from the command line: $ _filedir in $ echo ${COMPREPLY[@]} test doc .git contrib i.e. it's only showing the directories, not showing the files we're looking for. After this commit: $ . bash_completion $ _filedir in $ echo ${COMPREPLY[@]} test doc .git contrib bash_completion.sh.in Makefile.in $ Which is the expected behaviour.
This commit is contained in:
parent
6b30acc9ac
commit
00560a88b4
@ -588,7 +588,7 @@ _filedir()
|
|||||||
#
|
#
|
||||||
if [[ "$1" != -d ]]; then
|
if [[ "$1" != -d ]]; then
|
||||||
xspec=${1:+"!*.$1"}
|
xspec=${1:+"!*.$1"}
|
||||||
if [[ ${cur:0:1} == "'" && ${BASH_VERSINFO[0]} -ge 4 ]]; then
|
if [[ ${BASH_VERSINFO[0]} -ge 4 ]]; then
|
||||||
toks=( ${toks[@]-} $(
|
toks=( ${toks[@]-} $(
|
||||||
eval compgen -f -X \"\$xspec\" -- $quoted
|
eval compgen -f -X \"\$xspec\" -- $quoted
|
||||||
) )
|
) )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user