Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

internal error when providing bad options #70

Closed
banister opened this issue Jun 26, 2012 · 2 comments
Closed

internal error when providing bad options #70

banister opened this issue Jun 26, 2012 · 2 comments

Comments

@banister
Copy link

Not sure if you consider this a bug, but the error i get when providing bad options ls -mj (where 'j' is not a defined option) results in a pretty low-level error:

[3] (pry) main: 0> ls -mj
NoMethodError: undefined method `count' for nil:NilClass
from /Users/john/.rvm/gems/ruby-1.9.3-p194/gems/slop-3.3.1/lib/slop.rb:495:in `block in execute_multiple_switches'
[4] (pry) main: 0> cat --ex
Exception: NoMethodError: undefined method `count' for nil:NilClass
--
From: /Users/john/.rvm/gems/ruby-1.9.3-p194/gems/slop-3.3.1/lib/slop.rb @ line 495 @ level: 0 of backtrace (of 58).

    490:   # Returns nothing.
    491:   def execute_multiple_switches(option, argument, index)
    492:     execute_option(option, nil, index)
    493:     argument.split('').each do |key|
    494:       opt = fetch_option(key)
 => 495:       opt.count += 1
    496:       execute_option(opt, nil, index, key)
    497:     end
    498:   end
    499: 
    500:   # Extract an option from a flag.
[5] (pry) main: 0> wtf??
Exception: NoMethodError: undefined method `count' for nil:NilClass
--
 0: /Users/john/.rvm/gems/ruby-1.9.3-p194/gems/slop-3.3.1/lib/slop.rb:495:in `block in execute_multiple_switches'
 1: /Users/john/.rvm/gems/ruby-1.9.3-p194/gems/slop-3.3.1/lib/slop.rb:493:in `each'
 2: /Users/john/.rvm/gems/ruby-1.9.3-p194/gems/slop-3.3.1/lib/slop.rb:493:in `execute_multiple_switches'
 3: /Users/john/.rvm/gems/ruby-1.9.3-p194/gems/slop-3.3.1/lib/slop.rb:442:in `process_item'
 4: /Users/john/.rvm/gems/ruby-1.9.3-p194/gems/slop-3.3.1/lib/slop.rb:387:in `block in parse_items'
 5: /Users/john/.rvm/gems/ruby-1.9.3-p194/gems/slop-3.3.1/lib/slop.rb:384:in `each'
 6: /Users/john/.rvm/gems/ruby-1.9.3-p194/gems/slop-3.3.1/lib/slop.rb:384:in `each_with_index'
 7: /Users/john/.rvm/gems/ruby-1.9.3-p194/gems/slop-3.3.1/lib/slop.rb:384:in `parse_items'
 8: /Users/john/.rvm/gems/ruby-1.9.3-p194/gems/slop-3.3.1/lib/slop.rb:202:in `parse!'
 9: /Users/john/ruby/projects/pry/lib/pry/command.rb:467:in `call'
10: /Users/john/ruby/projects/pry/lib/pry/command.rb:394:in `call_with_hooks'
11: /Users/john/ruby/projects/pry/lib/pry/command.rb:372:in `call_safely'
12: /Users/john/ruby/projects/pry/lib/pry/command.rb:319:in `process_line'
13: /Users/john/ruby/projects/pry/lib/pry/command_set.rb:343:in `process_line'
14: /Users/john/ruby/projects/pry/lib/pry/pry_instance.rb:423:in `process_command'
15: /Users/john/ruby/projects/pry/lib/pry/pry_instance.rb:407:in `retrieve_line'
16: /Users/john/ruby/projects/pry/lib/pry/pry_instance.rb:304:in `block in r'
17: /Users/john/ruby/projects/pry/lib/pry/pry_instance.rb:301:in `loop'
18: /Users/john/ruby/projects/pry/lib/pry/pry_instance.rb:301:in `r'
19: /Users/john/ruby/projects/pry/lib/pry/pry_instance.rb:271:in `re'
[6] (pry) main: 0> 
@rking
Copy link

rking commented Jun 26, 2012

"Not sure if you consider this a bug" ⇐ Timidsauce.

That's a total bug. =P

@leejarvis
Copy link
Owner

3.3.2 pushed with this fix included. Thanks for reporting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants