View Single Post
Old October 9th, 2013, 07:27 PM   #1124 (permalink)
EarlyMon
The PearlyMon
 
EarlyMon's Avatar
 
Join Date: Jun 2010
Location: New Mexico, USA
Posts: 44,013
 
Device(s): LTEvo, 3vo, and Shift
Carrier: Sprint

Thanks: 41,676
Thanked 54,808 Times in 21,856 Posts
Default

Quote:
Originally Posted by palmtree5 View Post
Ok, having issues with bash completion. I want it to complete on arguments for a given command. It doesn't do that.

Example:

I type sudo pacman --sy<TAB> and I want it to complete to --sync

I know this is the default behavior in Ubuntu (which is one thing I actually like having) but I'm on Arch and only have tab completion to a certain extent (completing commands, showing what package contains a command if I try to run something that isn't installed, etc)
Not sure, but look at importing /etc/bash_completion.d from an Ubuntu distribution.

I think all they've done is overloaded the common commands using complete and compgen.

http://askubuntu.com/questions/95211/how-do-i-set-up-bash-completion-for-command-arguments

Google for bash complete compgen to see scripts for adding options for your own commands.

I never knew argument completion existed. I've only used it for files and paths lol.
__________________
|

Minutus cantorum, minutus balorum, minutus carborata descendum pantorum.

Links: Site Rules / Guidelines -and- Zero Tolerance Policy (All Members Read)


For right-on help, the Thanks button is on the right of the post.
For anything out in left field, the /!\ report button is to the left.

Remember, it's our forums and we're all in this together - so let's keep it cool!

Shoot the breeze at the best new gun forum!
EarlyMon is offline  
Reply With Quote
The Following User Says Thank You to EarlyMon For This Useful Post:
palmtree5 (October 9th, 2013)