LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   Bash auto-completion question (http://www.linuxquestions.org/questions/linux-general-1/bash-auto-completion-question-639271/)

PatrickNew 05-02-2008 02:29 AM

Bash auto-completion question
 
So I noticed something odd the other day. My bash (Debian lenny) will autocomplete commands for me, as expected. However, for some commands, it will also autocomplete the options. For, example, if I type "dd ib" and then hit tab, it will complete to "dd ibs=".

How do these programs go about notifying bash of their options? Is there some method of pre-registering? Or are all of these commands actually bash builtins?

GosthMan 05-02-2008 02:51 AM

yes you can make add commands to bash completition using alias
Example:
alias "ps-status"="ps aux"
this will add the command ps-status to bash
Or if you have an custom made bash script you can create an simlink to /sbin/

elliott678 05-02-2008 02:56 AM

It should be the same in Debian as it is in Arch, check out /etc/bash_completion and maybe /etc/bash_completion.d/ if it exists.

PatrickNew 05-03-2008 12:31 AM

That makes a lot more sense now, thanks! I didn't know about that config file, cool.


All times are GMT -5. The time now is 08:42 PM.