# Commonly agreed command line options gem?

**URL:** <https://www.ruby-forum.com/t/commonly-agreed-command-line-options-gem/157518>\
**Category:** Ruby\
**Created:** [January 12, 2009, 3:36pm UTC](https://www.ruby-forum.com/t/commonly-agreed-command-line-options-gem/157518 "2009-01-12T15:36:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![LAMBEAU\_Bernard](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/5fc32e/32.png) [@LAMBEAU\_Bernard](https://www.ruby-forum.com/u/LAMBEAU_Bernard)\
**Post date:** [January 12, 2009, 3:36pm UTC](https://www.ruby-forum.com/t/commonly-agreed-command-line-options-gem/157518/1 "2009-01-12T15:36:54Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![LAMBEAU\_Bernard](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/5fc32e/32.png) [@LAMBEAU\_Bernard](https://www.ruby-forum.com/u/LAMBEAU_Bernard)\
**Post date:** [January 12, 2009, 4:23pm UTC](https://www.ruby-forum.com/t/commonly-agreed-command-line-options-gem/157518/2 "2009-01-12T16:23:54Z")

</div>

On Mon, Jan 12, 2009 at 3:35 PM, LAMBEAU Bernard [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> 

OptionParser is in ruby core:

[http://www.ruby-doc.org/core/classes/OptionParser.html](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.

---

<div class="post-metadata">

**Author:** ![LAMBEAU\_Bernard](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/5fc32e/32.png) [@LAMBEAU\_Bernard](https://www.ruby-forum.com/u/LAMBEAU_Bernard)\
**Post date:** [January 13, 2009, 11:06pm UTC](https://www.ruby-forum.com/t/commonly-agreed-command-line-options-gem/157518/3 "2009-01-13T23:06:10Z")

</div>

I am used GetoptLong class in stdlib:  
[http://www.ruby-doc.org/stdlib/libdoc/getoptlong/rdoc/index.html](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

---

<div class="post-metadata">

**Author:** ![LAMBEAU\_Bernard](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/5fc32e/32.png) [@LAMBEAU\_Bernard](https://www.ruby-forum.com/u/LAMBEAU_Bernard)\
**Post date:** [January 14, 2009, 11:32pm UTC](https://www.ruby-forum.com/t/commonly-agreed-command-line-options-gem/157518/4 "2009-01-14T23:32:59Z")

</div>

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.
