Help with OptionParser

  • Thread starter Bryan Richardson
  • Start date
B

Bryan Richardson

[Note: parts of this message were removed to make it a legal post.]

Hello all,

I'm needing some help with OptionParser. I'm wanting to use it to parse a
string rather than ARGV, but when I pass the parse method a string of
options, i get the following error:

undefined method `shift' for "--help":String (NoMethodError)

Is there a way I can format the string of options so OptionParser can use
it?

Thanks! -- BTR
 
G

Giles Bowkett

I'm needing some help with OptionParser. I'm wanting to use it to parse a
string rather than ARGV, but when I pass the parse method a string of
options, i get the following error:

undefined method `shift' for "--help":String (NoMethodError)

Is there a way I can format the string of options so OptionParser can use
it?

AFAIK the easiest solution is to give it an array which contains just
one string.

--
Giles Bowkett

Podcast: http://hollywoodgrit.blogspot.com
Blog: http://gilesbowkett.blogspot.com
Portfolio: http://www.gilesgoatboy.org
Tumblelog: http://giles.tumblr.com
 
B

Bryan Richardson

[Note: parts of this message were removed to make it a legal post.]

Sweet! Thanks.
 

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

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,220
Latest member
MathewSant

Latest Threads

Top