On Tue, Jul 24, 2012 at 9:18 PM, Panagiotis Atmatzidis
<[email protected]> wrote:

> opts.on('-s', '--sort OPT', [:date, :country, :ip], 'Sorts by [date, country, 
> ip-frequency]') do |sort|
>     options[:sort] = sort
>  end

> [...]
>         # opts.on('-s', '--sort OPT', [:date, :country, :ip], 'Sorts by 
> [date, country, ip-frequency]') do |sort|
>         elsif options[:sort]
>                 if options[:sort] == 'date'
>                         $f2b.sort_by_date
>                 elsif options[:sort] == "country" # <--- something like this?
>                         # etc...
> [...]
>
> Any sort of hints are always welcome.

$ irb19 -r optparse
irb(main):001:0> OptionParser.new {|o| o.on("-s O", [:a, :b]){|v| p v,
v.class}}.parse %w{-s a}
:a
Symbol
=> []

Nice pun, btw. :-)

Kind regards

robert

-- 
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/

-- You received this message because you are subscribed to the Google Groups 
ruby-talk-google group. To post to this group, send email to 
[email protected]. To unsubscribe from this group, send email 
to [email protected]. For more options, visit this 
group at https://groups.google.com/d/forum/ruby-talk-google?hl=en

Reply via email to