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

  • Thread starter Iñaki Baz Castillo
  • Start date
I

Iñaki Baz Castillo

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

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

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

Thanks.

=2D-=20
I=C3=B1aki Baz Castillo
 
S

Stefano Crocco

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=20
OptionParser to learn more about it (you need to require 'optparse' before =
you=20
can use it)

Stefano
 
N

Nikita Petrov

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.

You can also try "getoptlog" library.
 
I

Iñaki Baz Castillo

El S=C3=A1bado, 5 de Abril de 2008, Stefano Crocco escribi=C3=B3:
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.


=2D-=20
I=C3=B1aki Baz Castillo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top