samlt's generic bash completion

Prikazi softvera i linkovi za preuzimanje

Moderators: Slackmuz, Urednik

Post Reply

Administrator
Administrator
offline
User avatar

Posts: 4590
Joined: 04 Feb 2011, 20:32
Location: Beograd
Contact:

Post Napisano: 03 Jan 2012, 23:53


Ovo je mali skript za bash-completion (paket se nalazi u /extra na dvd-u). Napisan je na Gentoo, ali ne vidim zašto ne bi radio i na drugim distribucijama.

sgbc pravi autocomplete pravila na osnovu help prikaza komandi (napr: wget --help). Nisam ga testirao, ali deluje zanimljivo.
I've written quite a few personnal bash completions and have realised that even if some completions can only be specific to one given command(to be really usefull) but most of the time they're easy: they have to deal with easy stuff like short&long options optionally taking a parameter which itself can sometime be completed. So I wrote a generic, yet somewhat extensible, bash completion.

Once you have it installed, here is how you can start using it for your amazing new script:

Code: Select all

add_sgbc_for command
And that's it! You can enjoy your TAB key with it too:)

For those wondering, there's no magic here, it just uses the help message provided it's sufficiently formated.
http://forums.gentoo.org/viewtopic-t-904290.html
https://gitorious.org/sgbc


Post Reply

Who is online

Users browsing this forum: No registered users and 19 guests