Commonly agreed command line options gem?


#1

Hi,

  • Is there a commonly agreed gem for parsing command line options of a
    script (ARGV) ?
  • If no, does anyone know a good one ?

In all cases (as I’m relatively new to Ruby), what heuristic do you
use to select the gems you need? There actually a lot of gems
available and selecting the good one (still maintained, well tested,
famous ruby developers maybe (?), …) is pretty hard to me.

Thanks
blambeau


#2

On Mon, Jan 12, 2009 at 3:35 PM, LAMBEAU Bernard removed_email_address@domain.invalid
wrote:

OptionParser is in ruby core:

http://www.ruby-doc.org/core/classes/OptionParser.html

I am very happy with Ara Howard’s “main” gem, though.
It’s very easy to use.

Jesus.


#3

I am used GetoptLong class in stdlib:
http://www.ruby-doc.org/stdlib/libdoc/getoptlong/rdoc/index.html

Just look at that self-explanatory example and You’re ready to go.

Regards,
Jarmo


#4

LAMBEAU Bernard wrote:

Hi,

  • Is there a commonly agreed gem for parsing command line options of a
    script (ARGV) ?
  • If no, does anyone know a good one ?

In all cases (as I’m relatively new to Ruby), what heuristic do you
use to select the gems you need? There actually a lot of gems
available and selecting the good one (still maintained, well tested,
famous ruby developers maybe (?), …) is pretty hard to me.

Thanks
blambeau

My absolute favorite is “trollop”. It is mega-mega awesome.