The {HelpRenderer} class is responsible for generating a string containing the help for a given command, intended to be printed on the command line.
The indentation of descriptions
The line width of the help output
The spacing between an option name and option description
@return [String] The help text for this command
# File lib/cri/help_renderer.rb, line 27 def render text = '' append_summary(text) append_usage(text) append_description(text) append_subcommands(text) append_options(text) text end
Creates a new help renderer for the given command.
@param [Cri::Command] cmd The command to generate the help for
@option params [Boolean] :verbose true if the help output should be
verbose, false otherwise.
# File lib/cri/help_renderer.rb, line 20 def initialize(cmd, params = {}) @cmd = cmd @is_verbose = params.fetch(:verbose, false) @io = params.fetch(:io, $stdout) end