lib/bundler/vendor/thor/lib/thor.rb in bundler-2.1.0.pre.2 vs lib/bundler/vendor/thor/lib/thor.rb in bundler-2.1.0.pre.3
- old
+ new
@@ -173,11 +173,11 @@
meth = normalize_command_name(command_name)
command = all_commands[meth]
handle_no_command_error(meth) unless command
shell.say "Usage:"
- shell.say " #{banner(command)}"
+ shell.say " #{banner(command).split("\n").join("\n ")}"
shell.say
class_options_help(shell, nil => command.options.values)
if command.long_description
shell.say "Description:"
shell.print_wrapped(command.long_description, :indent => 2)
@@ -396,10 +396,13 @@
# thor class by another ways which is not the Bundler::Thor::Runner. It receives
# the command that is going to be invoked and a boolean which indicates if
# the namespace should be displayed as arguments.
#
def banner(command, namespace = nil, subcommand = false)
- "#{basename} #{command.formatted_usage(self, $thor_runner, subcommand)}"
+ $thor_runner ||= false
+ command.formatted_usage(self, $thor_runner, subcommand).split("\n").map do |formatted_usage|
+ "#{basename} #{formatted_usage}"
+ end.join("\n")
end
def baseclass #:nodoc:
Bundler::Thor
end