module Thor::Invocation

def _prepare_for_invocation(name, sent_task=nil) #:nodoc:

:nodoc:

given or even a Thor::Task object.
take into account that a just a task name from the current class was
Prepare for invocation in the instance level. In this case, we have to
def _prepare_for_invocation(name, sent_task=nil) #:nodoc:
  if name.is_a?(Thor::Task)
    task = name
  elsif task = self.class.all_tasks[name.to_s]
    object = self
  else
    object, task = self.class.prepare_for_invocation(nil, name)
    task ||= sent_task
  end
  # If the object was not set, use self and use the name as task.
  object, task = self, name unless object
  return object, _validate_task(object, task)
end