From: nobu.nokada@... Date: 2003-06-16T00:44:33+09:00 Subject: Re: ignoring invalid options with optparse Hi, At Sat, 14 Jun 2003 02:48:40 +0900, Paul Brannan wrote: > I'd like for optparse to ignore invalid options so that I can pass them > to ORB_init. Is this possible? OptionParser::InvalidOption has an accessor "args". You'll be possilbe to: other_options = [] begin opts.parse! rescue OptionParser::InvalidOption => e other_options.concat e.args end # ... and orb = CORBA::ORB_init($0, other_options + ARGV) > Also, I noticed that getoptlong lets me use: > ruby foo.rb --opt arg > > but optparse requires: > ruby foo.rb --opt=arg > > Is it possible to get optparse to allow the form without '='? $ ruby -roptparse -e 'ARGV.options{|opt|opt.on("--opt=ARG"){|@arg|};opt.parse!};p self,ARGV' -- --opt arg # [] -- Nobu Nakada