From: Rodrigo Rosenfeld Rosas Date: 2011-07-10T08:19:02+09:00 Subject: [ruby-core:37940] Re: [Ruby 1.9 - Feature #5010][Open] Add Slop(-like) in stdlib and deprecate current OptionParser API Em 09-07-2011 20:13, Nobuyoshi Nakada escreveu: > Hi, > > At Sun, 10 Jul 2011 08:01:58 +0900, > Rodrigo Rosenfeld Rosas wrote in [ruby-core:37936]: >> This is the equivalent in Slop: >> >>
>> require 'slop'
>>
>> opts = Slop.parse do
>>    banner "Usage: example.rb [options]"
>>    on :v, :verbose, "Run verbosely", :default =>  true
>> end
>>
>> p opts.to_hash
>> 
> Hidden instance_eval is cause of confusion. It's a way > OptionParser has thrown away. Sorry, Nobu, I didn't get it. Could you explain it better?