class Toka::HelpPageRenderer

Overview

Renderer for a OptionDescriptor, to be shown on a terminal.

By default, the user of your program can access this using the defualt arguments "--help" and "-h". You can disable this if you want, see Toka.mapping.

Manual invocation

To manually render the help page, simply use #to_s:

help = Toka::HelpPageRenderer.new(YourOptionClass)
puts help.to_s

Defined in:

toka/help_page_renderer.cr

Constant Summary

BASE_INDENT = (OPTION_INDENT.size + 4) + 2
MAX_ALIGN = 20
OPTION_INDENT = " "

Constructors

Instance Method Summary

Constructor Detail

def self.new(options, colors : Bool = true) #

[View source]

Instance Method Detail

def render_option(io, option) #

[View source]
def render_option_list(io, options) #

[View source]
def render_options(io) #

[View source]
def to_s(io) #

[View source]