Method: Textbringer::Commands#command_help
- Defined in:
- lib/textbringer/commands/help.rb
#command_help(cmd) ⇒ Object
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/textbringer/commands/help.rb', line 67 def command_help(cmd) s = format("%s:%d\n", *cmd.block.source_location) s << "-" * (Window.columns - 2) + "\n" s << "#{cmd.name}" if !cmd.block.parameters.empty? s << "(" s << cmd.block.parameters.map { |_, param| param }.join(", ") s << ")" end s << "\n\n" s << "-" * (Window.columns - 2) + "\n\n" s << cmd.doc s << "\n" s end |