Module: Commander::HelpFormatter

Defined in:
lib/commander/help_formatters.rb,
lib/commander/help_formatters/base.rb,
lib/commander/help_formatters/terminal.rb,
lib/commander/help_formatters/terminal_compact.rb

Overview

Help Formatter

Commander's help formatters control the output when either the help command, or --help switch are called. The default formatter is Commander::HelpFormatter::Terminal.

Defined Under Namespace

Classes: Base, Context, ProgramContext, Terminal, TerminalCompact

Class Method Summary collapse

Class Method Details

.indent(amount, text) ⇒ Object

Indent each line of text (after the first) by amount spaces. Used by the help templates to align multi-line descriptions.



75
76
77
# File 'lib/commander/help_formatters.rb', line 75

def indent(amount, text)
  text.to_s.gsub("\n", "\n#{' ' * amount}")
end