Method: Bundler::Thor::Base::ClassMethods#handle_argument_error

Defined in:
lib/bundler/vendor/thor/lib/thor/base.rb

#handle_argument_error(command, error, args, arity) ⇒ Object

:nodoc:

Raises:

[View source]

618
619
620
621
622
623
624
625
# File 'lib/bundler/vendor/thor/lib/thor/base.rb', line 618

def handle_argument_error(command, error, args, arity) #:nodoc:
  name = [command.ancestor_name, command.name].compact.join(" ")
  msg = "ERROR: \"#{basename} #{name}\" was called with ".dup
  msg << "no arguments"               if     args.empty?
  msg << "arguments " << args.inspect unless args.empty?
  msg << "\nUsage: \"#{banner(command).split("\n").join("\"\n       \"")}\""
  raise InvocationError, msg
end