class Thor
def start(given_args=ARGV, config={})
script.invoke(:task, first_arg, second_arg, third_arg)
script = MyScript.new(args, options, config)
can simply initialize it:
from an array. If you are inside Ruby and want to use a Thor class, you
and invoke the task. This method is used when the arguments must be parsed
Parses the task and options from the given args, instantiate the class
def start(given_args=ARGV, config={}) super do meth = normalize_task_name(given_args.shift) task = all_tasks[meth] if task args, opts = Thor::Options.split(given_args) config.merge!(:task_options => task.options) else args, opts = given_args, {} end task ||= Thor::Task::Dynamic.new(meth) trailing = args[Range.new(arguments.size, -1)] new(args, opts, config).invoke(task, trailing || []) end end