Help with OptionParser

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

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 B.

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

Sweet! Thanks.