Get the latest tech news
Bash's sadly flawed smart (programmable) completion
useful feature called 'programmable completion' (this has sort of come up before). Programmable completion makes it possible for Bash to auto-complete things like command line options for the current program for you.
Programmable completion makes it possible for Bash to auto-complete things like command line options for the current program for you. This is because Bash has been told what the arguments to apt-get are and so 'knows' that they don't include files (this is actually wrong these days, but never mind). It's possible that Bash could do better with some heuristics, but the current situation is broadly easy to explain and reason about, even if the result is sometimes frustrating.
Or read this on Hacker News