Documentation
¶
Overview ¶
Package tui holds the look that every command shares: the styles, the help page, and the error block. A form, a spinner, or a progress bar joins it with the first command that needs one.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Help ¶
Help renders a help page, which ends with its examples. Columns take the width of the translated text.
func Output ¶
Output wraps a stream so that styles become plain text when color is off. noColor turns color off even with CLICOLOR_FORCE. Otherwise a stream that is not a terminal gets plain text unless CLICOLOR_FORCE asks for color. The decision reads only the environment and the stream, and never queries the terminal.
func Problems ¶
func Problems(errs, warnings []contract.Problem, label func(code contract.Code, warning bool) string, hint string) string
Problems renders errors, then warnings. Each one leads with a label that carries its code, such as error[USAGE_INVALID]:, then shows its hint after the hint label. label returns the translated label of a code.