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!

41 comments:

voyeg3r 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!

voyeg3r said...

How to get complete for aria2c command?

Narender Godara said...

Packers and movers Nashik
Packers and movers Navi mumbai
Packers and movers Noida
Packers and movers Panchkula

amine lahragui said...

Your work is very good and I appreciate you and hopping for some more informative posts. happy new year 2016 new year 2016 bonne année 2016 happy new year 2016 images feliz año nuevo 2016 imagenes de año nuevo 2016 feliz año 2016

Deepak Negi said...

Hey Guys Must Check these :-

I can do that live show
I can do that live telecast
I can do that Show live streaming
muharram 2015 Images
muharram 2015 Hd Wallpapers
Happy muharram 2015 Quotes
Muharram 2015 Slogans
muharram 2015 Karbala sms
Muharram 2015 Quotes
10 muharram 2015 Talwar Matam Videos
Muharram 2015 Zanjeer Juloos Videos
muharram 2015 Poems
Hazrat Hussain Poetry 2015
muharram 2015 Qawwali Mp3
10 Muharram 2015 shayari
Muharram 2015 Status
Labbaik ya hussain mp3 Songs
Hazrat Hussain Hd Images
Happy Childrens Day 2015 Images
Mastizaade Box Office Collection
Mastizaade Funny Scenes
Mastizaade hd Videos
Mastizaade Hot Scenes
Mastizaade Movie Review
Mastizaade Romantic Scenes
Mastizaade Songs
Mastizaade trailer film
World Aids Day 2015 Quotes
World Aids Day 2015 Posters
World Aids Day 2015 Themes
World Aids Day 2015 Slogans

Mary Brown said...

Java EE article is practical oriented and real time examples. How Java EE address the enterprise development is very important. for that you need a practical orieneted Java Training you need.

Online Java Training
Online Java Training from India
Java Training Institutes in Chennai
Java Training in Chennai
Java Training

Ranveer Patil said...

This is great do you have a catologue if so I would love one to share with friends and family.
ICC T20 World Cup 2016
Australia vs India time table

jasmine kaur said...

Super Bowl commercials 2016
best super bowl commercials
2016 Super Bowl Commercials
Super Bowl Commericals
Super Bowl halftime show 2016
Super Bowl 50
super bowl 50 tickets
super bowl halftime show
Super Bowl halftime show 2016
Super Bowl 50
super bowl 50 tickets
super bowl halftime show
Super Bowl commercials 2016
best super bowl commercials
2016 Super Bowl Commercials
Super Bowl Commericals

jawad zaib said...

Your Site Is Very Good and The Post is Well On Topic, Thanks for Sharing it with us.

New Songs 2016
the biggest attraction of the Samsung event
Samsung Galaxy S6 Edge Plus
Zaid Ali’s wedding photos goes viral
apple iphone 7 key note
Islamabad United Pakistan Super League 2016
poetry urdu sad 2016
New Sad Songs 2016
Shayari on dosti 2016

Rahul Bhatia said...

Watch ICC T20 World Cup 2016 Live Streaming, Live Telecast Of World T20 2016 India, India Vs Pakistan, India Vs Australia Watch Online, T20 World Cup Live Streaming Free.
t20 world cup 2016 live telecast channel india

t20 world cup 2016 coverage india

icc t20 world cup 2016 live streaming star sports

t20 world cup 2016 live score ball by ball

varun singh said...

Hello dear .You put really very helpful information.
It’s pretty worth enough for me. In my opinion, if all webmasters and bloggers made good content as you did, the web will be a lot more useful than ever before.

t20 world cup live stream
ipl live streaming
ipl 9 live streaming
real madrid vs barcelona live streaming
La Liga Live Streaming
India vs Pakistan T20 Live Streaming
India vs Pakistan T20 Live Streaming Asia Cup 2016

varun singh said...

Hello dear .You put really very helpful information.
It’s pretty worth enough for me. In my opinion, if all webmasters and bloggers made good content as you did, the web will be a lot more useful than ever before.

t20 world cup live stream
ipl live streaming
ipl 9 live streaming
real madrid vs barcelona live streaming
La Liga Live Streaming
India vs Pakistan T20 Live Streaming
India vs Pakistan T20 Live Streaming Asia Cup 2016

[Leader] said...

happy valentines day images
happy valentines day pictures
happy valentines day funny
happy valentines day pics

valentines day ideas
valentines day quotes
valentines day cards
valentines day poems

happy valentines day card
happy valentines day photos
valentines day gifts for him
valentines day gifts for her

ssc result 2016
t20 world cup 2016 schedule
ipl 2016 schedule
How to Get Rid of Freckles
ssc result 2016
Happy New Year 2017
UP SCHOLARSHIP
whatsapp status love
2016 UEFA European live stream

RUBEL said...

I hope ICC t20 World Cup 2016 becomes one of the best tournament of the world and it brings so much of entertainment. People will love to get live score, live streaming, etc..

ICC World T20 2016 Live Streaming and live score is very important for all of you.

ICC t20 World Cup 2016 Live Streaming
India vs Pakistan T20 Live Streaming
India vs Australia T20 live streaming
India vs New Zealand T20 Live Streaming
Vivo IPL 2016 Live Streaming and TV Telecast

Cheers.

Ankit Das said...

Want to know regular updates of Euro Cup 2016???? Venue-France,From 10th june-10july.... 24 teams,10 stadiums... Stay updated..

Euro Cup 2016
Euro Cup live Streaming
Euro Cup 2016 Live Streaming
Euro Cup 2016 Live Score
Euro Cup 2016 Schedule
Euro Cup 2016 Fixture

Amrish Singh said...

t20 world cup matches
Microsoft lumia 650
Soch na sake airlift

ipl 9 live score said...


fan movie opening day box office collection
fan movie online ticket booking on www.bookmyshow.com
fan movie 1st DAY box office collection
T20 wc live streaming 2016
happy mothers day quotes from son and daughter to mother

asds said...

Happy Mothers Day
Happy Mother's Day
Happy Mothers Day 2016
Happy Mother's Day 2016
Mothers Day 2016
Mother's Day 2016

Sonam Sharma said...

(ENG) England Team Squad Player List For World Cup 2016

Hadoop FS Commands said...

some popular post on internet
Coding
Commands
Hadoop
Opengl
Java
C program
Dsa
Project
HDFS
IOT
H/w req. in IOT
MapReduce
Big Data Analytics
BDP in Spark
Hdfs commands
SDN
Issues in IOT
Everything You Need To Know
Love shayari
How to lose belly fat
Hindi shayari
brainy quotes
Taylor swift net worth
Todays gold rate in mumbai
todays gols rate in mumbai
todays gold rate in banglore
Trick
IPL 9 Schedule

Champion League said...

I really enjoyed your awesome post, keep sharing more posts like this.
t20 world cup 2016 live
t20 world cup 2016 theme song
india vs pakistan t20 world cup live streaming
india vs new zealand t20 world cup live streaming
india vs pakistan asia cup live streaming

rajababu144 said...

Rocky Handsome Box Office Total Collection

Rocky Handsome Box Office Collection Rocky Handsome Box Office Prediction Box Office Collection

Rocky Handsome 1st Day Collection

Rocky Handsome 2nd Day Collection

Rocky Handsome Movie Collection

Hansika Mutwani said...

Fan movie collection prediction

Fan Movie Worldwide Collection

Easter Images
Funny Easter Images Wishes Quotes


Happy Holi

Media Culture said...

ICC World T20 2016 Schedule

World T20 2016 Schedule


ICC World T20 2016 timetable

Angelo leo said...

Easter Day Messages

Nina Dobrev said...

Very True Indeed. Looking forward for more articles like this one. Thanks.
Holi 2016 Wishes
Holi Wallpapers 2016
Holi Easy Rangoli Designs
www.holi2016wishes.in
Happy Holi Images 2016
Holi Hindi Shayari 2016
Holi Hot Sexy Images
Happy Holi Cards 2016
Holi Shayari
Holi SMS
Holi Funny Pictures
UPTET Result 2016
UPTET Result
SSC Constable GD Result
SSC Constable GD Result
REET Result 2015
REET Result

Fitoor box office said...

Fan Box Office Collection

Fan Opening Day Collection Prediction


Fan Movie Critics Review


SRK Fan Movie Budget


Fan Total Business Earning Report

Ayushi Kumar said...

happy memorial day 2016 quotes sayings
Happy Memorial Day Messages
memorial day images pictures for facebook

Moveezworld World said...

Fan Shah Rukh Khan Full Movie

Karan Arora said...

Mother’s Day Clipart Images
Mother’s Day Greetings Quotes
Mother’s Day Short Poems

Karan Arora said...

fan movie tickets booking
fan movie budget
fan movie collection prediction

Ladki Diwani said...

nach baliye 8 contestants 2016
nach baliye 8 contestants wiki
nach baliye 8 2016 contestants
nach baliye 8 start date 2016
nach baliye 8 contestants list start date host judges

nach baliye 8 contestants list 2016
nach baliye 8 contestants 2016 photos
nach baliye 8 judges list
nach baliye 8 watch live
nach baliye 8 contestants list start date host judges

nach baliye 8 contestants name list
nach baliye 8 2016 contestants and judges
nach baliye 8 host
nach baliye Season 8 contestants
nach baliye 8 contestants list start date host judges

Ladki Diwani said...

earth day 2016
earth day 2016 date
earth day 2016 event
earth day 2016 india
earth day celebration

anzac day 2016 australia
anzac day in australia
anzac day public holiday 2016
anzac day 2016 nz
anzac day 2016 nsw

game of thrones 6 trailer
game of thrones season 6 release date
game of thrones books
game of thrones season 6 episode 1
game of thrones season 6 jon snow

nazima said...

Cbse 10th Puducherry Results
Cbse 10th Daman Diu Results
Cbse 10th Andaman Nicobar Results

Pv Varma said...

Mothers Day Quotes images

Download

Happy Mothers Pictures with

Quotes

Mary Swift said...

Mothers Day Top Gifts
Mothers Day 2016 Gifts
Gift for mother

Somnath Roy said...

Awesome post,keep uploading more gift ideas for single moms

Somnath Roy said...

Thanks for sharing funny mother's day quotes

Amit Kumar said...



Thanks fot the post ! would you like to add some extra thing over this ?? yes.. then do reply me on this !
www.mahresult.nic.in
ssc result maharashtra 2016
Check Online 10th SSC Result 2016

SSC Online Results www.mahresult.nic.in
maharashtra board ssc result 2016

check online ssc board exam result 2016
ssc result 2016 maharashtra
10th Board Exam Result 2016 Maharashtra

Social Gtf said...


nice article.......
Earthcon Sanskriti
Earthcon Sanskriti Noida
Earthcon Sanskriti Noida Extension

Isabella Elin said...

Mother’s Day Attractive Gift