Closed gwynne closed 11 months ago
@swift-ci please test
@rauhul I have to be honest; this is my first time tinkering with Bash completion 😅. Here are the references I used in coming up with this:
compgen -X !*.ext
to handle extensions: _comp_compgen_filedir()
guts on tip of trunk bash-completion
2.x - it seems that the maintainer has planned a truly massive overhaul for the "2.12" release._filedir
from bash-completion
1.x.yq
CDPATH
handling built into bash-completion
@swift-ci please test
@gwynne it looks like some tests need to be updated:
if declare -F _filedir >/dev/null; then
_filedir 'txt'
_filedir 'md'
_filedir 'TXT'
_filedir 'MD'
+ _filedir -d
else
@gwynne it looks like some tests need to be updated:
Whoops, sorry! Incoming momentarily 😅
@swift-ci please test
This PR implements two TODOs left over in the Bash completion script generator code:
CompletionKind.file(extensions:)
did not actually honor theextensions
array. It now does so.CompletionKind.file(extensions:)
and.directory
now both preferentially invoke the_filedir
shell function frombash-completion
(v1 for Bash 3.2 & v2 for Bash 4.2+), if it is available in the shell environment at the time, falling back oncompgen
if it is not.Note: I could not find any open issues referring to these concerns.
Checklist