Tuesday, March 2, 2010

Man-page based Bash Completion

Hacked up this little function which you can use to get generic bash completion on any command based on the man page. You just need to source this file. Here's what it looks like when executed
mingus:~ 03:16:45 
$ wget --c[TAB]
--ca-certificate=file      --certificate=file         --convert-links
--ca-directory=directory   --connect-timeout=seconds  --cut-dirs=number
--certificate-type=type    --continue                 
Theoretically you could take this a step further and complete the values of the options as well. Many of the options say "--foo=file", "--foo file", "--bar host", etc.. You could parse out this "file" or "host" keyword and switch the completion style accordingly. If you 'apt-get install bash-completion' you'll get a ton of completion functions which specialize in host, file, and directory completion. Shouldn't be too hard to wire them in. If anyone gets the urge to do it, definitely share your results. The above code is stored in gist.github.com, so fork away!

10 comments:

Sergio said...

Awesome script! I mix lot tips and tricks about complete mixing portuguese and english in this post:
http://vivaotux.blogspot.com/2010/08/bash-melhorando-complementacao-de.html

Thanks!

Sergio said...

How to get complete for aria2c command?

Unknown said...

20170619 junda
oakley sunglasses sale
cheap jerseys wholesale
burberry outlet sale
cheap ray ban sunglasses
adidas uk store
michael kors outlet clearance
cheap nba jerseys
true religion outlet
ray ban sunglasses
nike air max 90

Farhan Khan said...

FCI Watchman

Admit Card 2017

CG SET Admit Card

2017

MP Patwari

Admit Card 2017

JEE Main 2018

Application Form

PNRD Assam

REcruitment 2017

Danish Ahmed said...

Thanks for sharing this article, now you can also check your Recuritment & Notification 2017-2018 by following below given links...

fci andhra pradesh watchman recuritment 2017

fci tamilnadu watchman recuritment 2017

xat notification 2018

jkbote polytechnic result 2017

Eillen Sharma said...

Escort service in Gurgaon
Escort service in Gurgaon

Escort service in Kolkata
Escort service in Bangalore
Escort service in Mumbai

Darren Demers said...

simply could not depart your website before suggesting that I extremely loved the usual info an individual supply on your visitors? Is going to be again frequently to check up on new posts gold shawls and wraps , shawl wholesale online , prom shawl , embroidered pashmina shawl , pashmina shawls manufacturers , shawl fashion , men's pashmina shawls , best pashmina shawls , buy shawl , pashmina shawl in nepal

escortservicegurgaon said...

call girls in Jaipur

Escorts Jaipur

Vip call girls in Jaipur

Russian Call Girls in Jaipur

Russian Escorts in Jaipur

Indipendent Call Girls in Jaipur

Indipendent Escorts in Jaipur

call girl service in Jaipur

Escorts service in Jaipur

Jaipur call girls

Jaipur Escorts Services

escorts in Jaipur

call girl in Jaipur


Women Seeking Men
Women Seeking Men Bangalore
Women Seeking Men in Bangalore
Women Seeking Men in Hydrabad
Women Seeking Men Chennai
Man Seeking Woman



escorts in Jaipur

call girl in Jaipur

----------------------------------------------------------------
escorts in Jaipur

call girl in Jaipur

Escorts Service Kolkata said...

escorts service in kolkata |
escorts service in kolkata |
escorts service in kolkata |
escorts service in kolkata |
escorts service in kolkata |

Unknown said...

How to Play Casino: Easy Guide to playing slots on
Casino games are played by 4 players, 토토 사이트 the average time they take turns worrione.com is https://tricktactoe.com/ around 14:20. The house is poormansguidetocasinogambling divided into three gri-go.com distinct categories: the house