views:

627

answers:

4

With bash, I can complete a command with TAB. Normally, it should also complete the command line switches: e.g. when I typed:

java -

it should show me the possibilities. It does not. How can I enable this preview?

See also Surprise! the shell suggests command line switches

+5  A: 

Take a look at Extended Bash Completion

ShuggyCoUk
+3  A: 

Related: http://stackoverflow.com/questions/776071/surprise-the-shell-suggests-command-line-switches

In the answers to that question there were several links to documentation. You might find what you look for there.

Joey
+1  A: 

you need to have bash_completion installed and then just add . /etc/bash_completion to you .bashrc

dunkyp
A: 

Depending on what Linux flavor you're using, you may want to add a package. For Fedora and related distributions, you need to add the separate package bash-completion to get this to work. I wouldn't be surprised if other distributions had this packaged as an optional 2nd package that you need to add in addition to the bash package.

Eddie