# Is there something better than getoptlong

**URL:** <https://www.ruby-forum.com/t/is-there-something-better-than-getoptlong/125472>\
**Category:** Ruby\
**Created:** [January 9, 2008, 12:33pm UTC](https://www.ruby-forum.com/t/is-there-something-better-than-getoptlong/125472 "2008-01-09T12:33:57Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![SunRaySon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/22d042/32.png) [@SunRaySon](https://www.ruby-forum.com/u/SunRaySon)\
**Post date:** [January 9, 2008, 12:33pm UTC](https://www.ruby-forum.com/t/is-there-something-better-than-getoptlong/125472/1 "2008-01-09T12:33:57Z")

</div>

Hi,

I there anything better than GetOptLong for parsing command line  
arguments.

Kiran.

---

<div class="post-metadata">

**Author:** ![SunRaySon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/22d042/32.png) [@SunRaySon](https://www.ruby-forum.com/u/SunRaySon)\
**Post date:** [January 9, 2008, 12:45pm UTC](https://www.ruby-forum.com/t/is-there-something-better-than-getoptlong/125472/2 "2008-01-09T12:45:08Z")

</div>

On Jan 9, 2008 12:33 PM, SunRaySon [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hi,
> 
> I there anything better than GetOptLong for parsing command line arguments.

I’ve used the main gem (gem install main) and I’m pretty happy with it.

Jesus.

---

<div class="post-metadata">

**Author:** ![SunRaySon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/22d042/32.png) [@SunRaySon](https://www.ruby-forum.com/u/SunRaySon)\
**Post date:** [January 9, 2008, 12:46pm UTC](https://www.ruby-forum.com/t/is-there-something-better-than-getoptlong/125472/3 "2008-01-09T12:46:23Z")

</div>

2008/1/9, SunRaySon [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> I there anything better than GetOptLong for parsing command line arguments.

[http://www.ruby-doc.org/stdlib/libdoc/optparse/rdoc/index.html](http://www.ruby-doc.org/stdlib/libdoc/optparse/rdoc/index.html)

Cheers

robert

---

<div class="post-metadata">

**Author:** ![SunRaySon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/22d042/32.png) [@SunRaySon](https://www.ruby-forum.com/u/SunRaySon)\
**Post date:** [January 9, 2008, 1:52pm UTC](https://www.ruby-forum.com/t/is-there-something-better-than-getoptlong/125472/4 "2008-01-09T13:52:39Z")

</div>

On Jan 9, 5:33 am, SunRaySon [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hi,
> 
> I there anything better than GetOptLong for parsing command line arguments.

gem install getopt

---

<div class="post-metadata">

**Author:** ![SunRaySon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/22d042/32.png) [@SunRaySon](https://www.ruby-forum.com/u/SunRaySon)\
**Post date:** [January 9, 2008, 12:51pm UTC](https://www.ruby-forum.com/t/is-there-something-better-than-getoptlong/125472/5 "2008-01-09T12:51:04Z")

</div>

SunRaySon a écrit :

> [Note: parts of this message were removed to make it a legal post.]
> 
> Hi,
> 
> I there anything better than GetOptLong for parsing command line arguments.
> 
> Kiran.

you can try the “main” gem

---

<div class="post-metadata">

**Author:** ![SunRaySon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/22d042/32.png) [@SunRaySon](https://www.ruby-forum.com/u/SunRaySon)\
**Post date:** [January 9, 2008, 2:04pm UTC](https://www.ruby-forum.com/t/is-there-something-better-than-getoptlong/125472/6 "2008-01-09T14:04:55Z")

</div>

SunRaySon wrote:

> > I there anything better than GetOptLong for parsing command line  
> > arguments.  
> > gem install trollop

---

<div class="post-metadata">

**Author:** ![SunRaySon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/22d042/32.png) [@SunRaySon](https://www.ruby-forum.com/u/SunRaySon)\
**Post date:** [January 9, 2008, 8:33pm UTC](https://www.ruby-forum.com/t/is-there-something-better-than-getoptlong/125472/7 "2008-01-09T20:33:27Z")

</div>

SunRaySon wrote:

> I there anything better than GetOptLong for parsing command line arguments.

Ok, there are already more than enough excellent libraries mentioned,  
but here’s one that’s tiny (~50 lines):

[http://redshift.sourceforge.net/argos.rb](http://redshift.sourceforge.net/argos.rb)
