From: Jim Freeze Date: 2002-07-31T20:24:40+09:00 Subject: Re: Question about GetoptLong On Wed, Jul 31, 2002 at 03:31:51PM +0900, Patrick Bennett wrote: > > > > > >Then, in the sample I gave earlier, I added the following: > > > > not_handled = [] > > opts.each do |opt, arg| > > case opt > > ## We handle log > > when "--log" > > puts "parsing: #{opt}: #{arg}" > > ## We pass cc > > else > > ## Unknown option (probably need some error checking here) > > not_handled << [opt, arg] > > end#case > > end#each > > > >When your done, add the not_handled array back to ARGV > > > > ARGV.unshift(not_handled).flatten! > > > > > > > Reasonable idea, but.... it still won't work since GetoptLong (wrongly > so IMO) raises an exception whenever it sees something it doesn't > understand, as well as eating the 'non-option' it just parsed - which in Yes. This method only works if you know all possible command options. Jim -- Jim Freeze If only I had something clever to say for my comment... ~