Skip to content

Failure to pass options when a method has optional arguments #4

@stevenkaras

Description

@stevenkaras

Given a program such as this:

require 'thunder'
class Example
  include Thunder
  option :verbose, type: Boolean
  desc :foo
  def foo(arg1 = 1, options = {})
    p arg1
    p options
  end
end
Example.new.start

when executed using ruby example.rb --verbose will show an empty options hash, but when executed using ruby example.rb 1 --verbose, will show the correct options being passed in.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions