Forum: Ruby question about converting Python to Ruby - getopt

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Mike S. (Guest)
on 2007-05-14 22:25
(Received via mailing list)
Is there an equivalent in Ruby of Python's getopt (it parses
command-line
arguments)?

Mike S.
darren kirby (Guest)
on 2007-05-14 22:39
(Received via mailing list)
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
Avdi G. (Guest)
on 2007-05-14 22:40
(Received via mailing list)
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.
This topic is locked and can not be replied to.