complete -f -o plusdirs -X '!*.foo' bar
Complete specific filenames and directories
-
30-06-2022 - |
Question
If I want Bash to complete only filenames with extension .foo
for the command bar
I can run
$ complete -f -X '!*.foo' bar
This, however, disables completion of directories preceding a .foo
file. How do I preserve completion of directories?
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow