Is there any Ruby parser for command inline parameters (ARGV[])?

Hi, I usually do Ruby scripts for some tasks and many of them allow
inline
parameters, for example:

./script1.rb -n -vv -o file.out filein

Is there any Ruby library/gem to parse inline parameters easily? this
is,
parsing ARGV Array.

Thanks.

On Saturday 05 April 2008, Iñaki Baz C. wrote:

Hi, I usually do Ruby scripts for some tasks and many of them allow inline
parameters, for example:

./script1.rb -n -vv -o file.out filein

Is there any Ruby library/gem to parse inline parameters easily? this is,
parsing ARGV Array.

Thanks.

There’s OptionParser which is included in ruby standard library. Use ri
OptionParser to learn more about it (you need to require ‘optparse’
before you
can use it)

Stefano

On 5 апр, 19:01, Iñaki Baz C. [email protected] wrote:


Iñaki Baz C.

You can also try “getoptlog” library.

El Sábado, 5 de Abril de 2008, Stefano C. escribió:

There’s OptionParser which is included in ruby standard library. Use ri
OptionParser to learn more about it (you need to require ‘optparse’ before
you can use it)

Thanks a lot, I’ll try it.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs