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:
Expected Output:
Child task received the following options: {"required_option"=>"some value"}
Actual Output:
No value provided for required options '--required-option'
Versions tested:
Given the following Thor class:
When I execute:
Expected Output:
Actual Output:
Versions tested: