Class: Thor
- Inherits:
-
Object
- Object
- Thor
- Defined in:
- lib/cinch/bot_template/main/thor.rb
Direct Known Subclasses
Cinch::BotTemplate::Bot, Cinch::BotTemplate::CLI::App, Cinch::BotTemplate::Config, Cinch::BotTemplate::Plugin
Defined Under Namespace
Class Method Summary collapse
- .command_help(shell, command_name) ⇒ Object (also: task_help)
Class Method Details
.command_help(shell, command_name) ⇒ Object Also known as: task_help
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/cinch/bot_template/main/thor.rb', line 4 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 ", ['white', :bold] shell.say "\b:" shell.say " #{(command)}" (shell, nil => command..values) if command.long_description shell.say "DESCRIPTION ", ['white', :bold] shell.say "\b:" shell.print_wrapped(command.long_description) else shell.say command.description end end |