injekt/slop — Issue #52: Long options don't work if using :multiple_switches (which is default)
Author: jorgenpt
Created: 2012-01-27 01:14:38+00:00
State: open

From irb, explicitly disabling multiple_switches:

1.9.2p290 :001 > opts = Slop.parse!(['--asd=foo'], :multiple_switches => false) do on '--asd='; end
=> #false, :help=>false, :banner=>nil, :ignore_case=>false, :autocreate=>false, :arguments=>false, :optional_arguments=>false, :multiple_switches=>false, :longest_flag=>3} ["#true, :optional_argument=>false, :tail=>false, :default=>nil, :callback=>nil, :delimiter=>\",\", :limit=>0, :match=>nil, :optional=>true, :required=>false, :as=>String, :autocreated=>false}"]>

From irb, default config:

1.9.2p290 :002 > opts = Slop.parse!(['--asd=foo']) do on :asd=; end
NoMethodError: undefined method `count=' for nil:NilClass
from /Users/jtjerno/.rvm/gems/ruby-1.9.2-p290@show_me/gems/slop-3.0.0/lib/slop.rb:471:in `block in execute_multiple_switches'
from /Users/jtjerno/.rvm/gems/ruby-1.9.2-p290@show_me/gems/slop-3.0.0/lib/slop.rb:469:in `each'
from /Users/jtjerno/.rvm/gems/ruby-1.9.2-p290@show_me/gems/slop-3.0.0/lib/slop.rb:469:in `execute_multiple_switches'
from /Users/jtjerno/.rvm/gems/ruby-1.9.2-p290@show_me/gems/slop-3.0.0/lib/slop.rb:407:in `process_item'
from /Users/jtjerno/.rvm/gems/ruby-1.9.2-p290@show_me/gems/slop-3.0.0/lib/slop.rb:369:in `block in parse_items'
from /Users/jtjerno/.rvm/gems/ruby-1.9.2-p290@show_me/gems/slop-3.0.0/lib/slop.rb:366:in `each'
from /Users/jtjerno/.rvm/gems/ruby-1.9.2-p290@show_me/gems/slop-3.0.0/lib/slop.rb:366:in `each_with_index'
from /Users/jtjerno/.rvm/gems/ruby-1.9.2-p290@show_me/gems/slop-3.0.0/lib/slop.rb:366:in `parse_items'
from /Users/jtjerno/.rvm/gems/ruby-1.9.2-p290@show_me/gems/slop-3.0.0/lib/slop.rb:195:in `parse!'
from /Users/jtjerno/.rvm/gems/ruby-1.9.2-p290@show_me/gems/slop-3.0.0/lib/slop.rb:122:in `init_and_parse'
from /Users/jtjerno/.rvm/gems/ruby-1.9.2-p290@show_me/gems/slop-3.0.0/lib/slop.rb:63:in `parse!'
from (irb):5