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 Bowkett

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

Sweet! Thanks.

···

On Jan 7, 2008 12:26 PM, Giles Bowkett <gilesb@gmail.com> wrote:

> 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