Today I discovered that the bash shell /bin/bash can perform auto-complete on switches to certain command line programs.
This is cool because it must mean that the shell can query the a program's switches before it is invoked.
An example is the --after-context switch to grep which shows a number of lines following the line that matched.
Use the tab key to auto-complete the switch once you have entered enough of it to be uniquely identified:
grep searchstring searchfile --af
Hit tab and it will auto-complete to
grep searchstring searchfile --after-context
I will update this page with any more auto-complete switches I find.