Re: I need some help with OptionsParser

c:\temp>

This thread is a testament to why I wrote the getopt package:

test.rb

require ‘getopt/long’
include Getopt

opts = Long.getopts([’–size’, ‘-s’, REQUIRED])
p opts[‘size’]

C:\ruby test.rb -s ‘Very Big’
“Very Big”

C:\

gem install getopt :slight_smile:

Regards,

Dan

Works!

Thanks :slight_smile:

PS: Thanks to everyone for the help! THought I was crazy here…

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