Method: Thor.command_help

Defined in:
lib/thor.rb

.command_help(shell, command_name) ⇒ Object Also known as: task_help

Prints help information for the given command.

Parameters

shell<Thor::Shell> command_name<String>


167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
# File 'lib/thor.rb', line 167

def command_help(shell, command_name)
  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
  class_options_help(shell, nil => command.options.values)
  if command.long_description
    shell.say "Description:"
    shell.print_wrapped(command.long_description, :indent => 2)
  else
    shell.say command.description
  end
end