bash completion
Paul Lussier
p.lussier at comcast.net
Fri Feb 10 14:05:03 EST 2006
Hi,
I don't know how many others are aware of this, but bash's command
line auto-completion is customizable and extensible. I just
discovered this myself this week. Take a look at /etc/bash_completion some time. You can write your own completion functions to go in ~/.bash_completion, and if you add this:
if [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
to your ~/.[profile,bashrc,bash_profile] you will have your own
completion functions for what ever you want. At work we've extended
bash_completion to include all the perforce commands, a bunch of Ant
stuff, and many of the options to our automated test suite.
In case it isn't obvious, you can have bash complete things which are
NOT commands in the file system. For example, you could have bash
complete on options like --foo. In the near future I'm planning on
adding the subversion command suite to my bash completion so do things
like:
sv<tab> up<tab>
rather than:
svn update
The possibilities are endless :)
--
Seeya,
Paul
More information about the gnhlug-discuss
mailing list