Question about converting Python to Ruby - getopt


#1

Is there an equivalent in Ruby of Python’s getopt (it parses
command-line
arguments)?

Mike S.


#2

quoth the Mike S.:

Is there an equivalent in Ruby of Python’s getopt (it parses command-line
arguments)?

Mike S.

There are two: GetOptLong and OptionParser. Both are in the Standard
Library.
I believe GetOptLong is closer to the Python implementation.

-d


#3

On 5/14/07, Mike S. removed_email_address@domain.invalid wrote:

Is there an equivalent in Ruby of Python’s getopt (it parses command-line
arguments)?

Look into the GetoptLong and optparse libraries. They are both part
of the Ruby standard library.