Method not available on this version
This method is only available on newer versions. The first available version of the method is shown here.
dispatch(meth, given_args, given_opts, config)
protected
The method responsible for dispatching given the args.
Show source
def dispatch(meth, given_args, given_opts, config)
meth ||= retrieve_command_name(given_args)
command = all_commands[normalize_command_name(meth)]
if !command && config[:invoked_via_subcommand]
given_args.unshift(meth)
command = all_commands[normalize_command_name(default_command)]
end
if command
args, opts = Bundler::Thor::Options.split(given_args)
if stop_on_unknown_option?(command) && !args.empty?
args.concat opts
opts.clear
end
else
args = given_args
opts = nil
command = dynamic_command_class.new(meth)
end
opts = given_opts || opts || []
config[:current_command] = command
config[:command_options] = command.options
instance = new(args, opts, config)
yield instance if block_given?
args = instance.args
trailing = args[Range.new(arguments.size, -1)]
instance.invoke_command(command, trailing || [])
end