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

Cannot invoke tasks with required options from another task #614

Open
clemensp opened this issue Aug 1, 2018 · 0 comments
Open

Cannot invoke tasks with required options from another task #614

clemensp opened this issue Aug 1, 2018 · 0 comments

Comments

@clemensp
Copy link

clemensp commented Aug 1, 2018

Given the following Thor class:

class Demo < Thor
  desc "parent_task", "this task will invoke the child task"

  def parent_task
    invoke(:child_task, [], required_option: "some value")
  end

  desc "child_task", "to be invoked by parent task"
  method_option "required_option", type: :string, required: true

  def child_task
    puts "Child task received the following options: #{p options}"
  end
end

When I execute:

thor demo:parent_task

Expected Output:

Child task received the following options: {"required_option"=>"some value"}

Actual Output:

No value provided for required options '--required-option'

Versions tested:

  • 0.19.1
  • 0.20.0
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

1 participant