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!

15 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

Danish Ahmed said...

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

police si admit card 2017

gpsc medical officer admit card 2017

tamilnadu teacher recuritment 2017

bihar police constable recuritment 2017

gujarat high court recruitment 2017

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

Ổn áp Standa chính hãng 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
on ap standa 5kva|on ap standa 7,5kva|on ap standa 10kva|on ap standa 15kva|on ap standa 20kva|on ap standa 30kva|on ap standa 45kva|on ap standa 60kva|on ap standa 75kva|on ap standa 100kva

Unknown said...

I like the post format as you create user engagement in the complete article. It seems round up of all published posts. Thanks for gauging the informative posts.
cara menggugurkan kandungan
obat aborsi
kalkulator kehamilan
tanda tanda kehamilan

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...

The collection Marts can Helps you to find latest trends. We have latest designs at comforter Set, Bed Sheets, Sofa Covers, Baby Comforter Set, Pillow Covers, Blankets and much more. Our Service is provide high Quality Stuff and Satisfaction of customer. You can view latest desigsn at our facebook page. https://web.facebook.com/The-Collection-Marts-317300915823297/.
linen sheets , khaadi sale 2018 with price , linen sheets , nishat linen bed sheets , bedspread online , bed sets , jaipuri razai price , sectional sofa covers , cheap cushion covers

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

Anaminka said...



If you would like to book an escort like Russian Escorts in Haridwar for an upcoming time, you can use our mail reservation type where you can specify a substitute woman should your perfect option not be available. You will need to provide us with your real name on thereservation type, but be confident we are very distinct and will keep your private information private and protected. Check our other Services...
Bengali Call Girls in Kolkata
Call Girls in Ahmedabad
Call Girls in Faridabad
Call Girls in Goa
Call Girls in Gurgaon
Escorts in Faridabad

HOT AND SEXY INDEPENDENT ESCORTS IN LUCKNOW said...

THANK YOU FOR VISITING MY WEBSITE:-
russian escorts in gurgaon
housewife escorts in gurgaon
gurgaon escort services
gurgaon escorts
escorts in gurgaon
escort services in gurgaon
gurgaon call girls
call girls in gurgaon

Miss Nikita Agarwal said...

Very Good way of attracting your reader's attention is to write blog like you. Please do contact me on genuinehotelescorts@gmail.com for
Jaipur call girls
Jaipur call girls
Jaipur call girls
Delhi call girls
Guwahati call girls
Guwahati call girls
Guwahati call girls
Guwahati call girls
Aerocity call girls
Lucknow call girls