How to enable tab completion from the terminal specific to the executable

Posted by Synesso on Stack Overflow See other posts from Stack Overflow or by Synesso
Published on 2010-03-14T00:03:17Z Indexed on 2010/03/14 0:05 UTC
Read the original article Hit count: 456

Filed under:
|
|

In bash, I believe it is possible to enable tab completion on the terminal for terms that are specific to the executable being invoked.

For example, given an executable "eat" with valid arguments {cake, carrot, banana}, typing 'eat car' should complete to 'eat carrot'.

I believe this is possible because I have seen it with 'ant' tab-completing its targets (though how this was set up I don't know).

How can this behaviour be implemented?

© Stack Overflow or respective owner

Related posts about tab-complete

Related posts about bash