Make _filedir's "fallback to everything" behavior optional, and off by default.
Configuration variable: COMP_FILEDIR_FALLBACK http://thread.gmane.org/gmane.comp.shells.bash.completion.devel/3357
This commit is contained in:
parent
bae27caab0
commit
2f90dc7ecf
@ -571,8 +571,9 @@ _filedir()
|
||||
toks+=( $( compgen -f -X "$xspec" -- $quoted ) )
|
||||
fi
|
||||
|
||||
# If the filter failed to produce anything, try without it
|
||||
[[ -n "$1" && "$1" != -d && ${#toks[@]} -lt 1 ]] && \
|
||||
# If the filter failed to produce anything, try without it if configured to
|
||||
[[ -n ${COMP_FILEDIR_FALLBACK:-} && \
|
||||
-n "$1" && "$1" != -d && ${#toks[@]} -lt 1 ]] && \
|
||||
toks+=( $( compgen -f -- $quoted ) )
|
||||
|
||||
[ ${#toks[@]} -ne 0 ] && compopt -o filenames 2>/dev/null
|
||||
|
@ -30,6 +30,11 @@ Environment variables
|
||||
remotely checked-out files. This requires passwordless access to the
|
||||
remote repository. Default is unset.
|
||||
|
||||
*COMP_FILEDIR_FALLBACK*::
|
||||
If set and not null, completions that look for filenames based on their
|
||||
"extensions" will fall back to suggesting all files if there are none
|
||||
matching the sought ones.
|
||||
|
||||
*COMP_IWLIST_SCAN*::
|
||||
If set and not null, `iwconfig` completion will try to complete on
|
||||
available wireless networks identifiers. Default is unset.
|
||||
|
Loading…
x
Reference in New Issue
Block a user