bash-completion
bash-completion copied to clipboard
Missing wildcard support
given e.g. a directory with
graphviz-gvedit.spec graphviz-plugins.spec graphviz-smyrna.spec graphviz.spec
ls *spec<TAB><TAB>
does not work. That is that _longopt does not support wild cards nor the completion options are used to do that if _longopt does not return anything.
Compare with pull request https://github.com/scop/bash-completion/pull/41
A post at superuser.com echoes bitstreamout's observation that compgen/compopt -o bashdefault is useful.
This reproduces in a minimal debootstrap environment for Debian 11, where ls /*<TAB>
fails to show completions after . /usr/share/bash-completion/bash_completion
is run, and in a full install can be seen from login until a shopt -u progcomp
/complete -r
/suitable edit to ~/.bashrc
debian's bash-completion 1:2.11-2 patches as suggested for this test case with:
--- bash_completion.orig 2021-11-07 10:26:31.218296781 +0000
+++ bash_completion 2021-11-07 10:26:50.422391751 +0000
@@ -623,6 +623,8 @@
# 2>/dev/null for direct invocation, e.g. in the _filedir unit test
compopt -o filenames 2>/dev/null
COMPREPLY+=("${toks[@]}")
+ else
+ compopt -o bashdefault 2>/dev/null
fi
} # _filedir()