class Thor::Group

def dispatch(command, given_args, given_opts, config) #:nodoc:

:nodoc:
The method responsible for dispatching given the args.
def dispatch(command, given_args, given_opts, config) #:nodoc:
  if Thor::HELP_MAPPINGS.include?(given_args.first)
    help(config[:shell])
    return
  end
  args, opts = Thor::Options.split(given_args)
  opts = given_opts || opts
  instance = new(args, opts, config)
  yield instance if block_given?
  if command
    instance.invoke_command(all_commands[command])
  else
    instance.invoke_all
  end
end