Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Init ¶
func Init(preferences *prefs.Preferences)
Init initializes a default global UI, accessible via the package functions.
func Line ¶ added in v0.23.0
func Line(format string, a ...interface{})
Line calls Line on the default UI
func LineIndent ¶ added in v0.23.0
LineIndent calls LineIndent on the default UI
Types ¶
type UI ¶ added in v0.23.0
type UI struct { Indent int // Cols holds the column width for text wrapping. For the default UI and // its children, It is either the width of the terminal, or defaultCols, // minus rightPad. Cols int // EnableProgress is whether progress events should be displayed EnableProgress bool // EnableHints is whether hints should be displayed EnableHints bool }
UI exposes methods for creating a terminal ui
func (*UI) Child ¶ added in v0.23.0
Child returns a new UI, with settings from the receiver UI, and Indent increased by the provided value.
func (*UI) Hint ¶ added in v0.23.0
Hint handles the ui output for hint/onboarding messages, when enabled
func (*UI) Line ¶ added in v0.23.0
Line writes a formatted string followed by a newline to stdout. Output is word wrapped, and terminated by a newline.
func (*UI) LineIndent ¶ added in v0.23.0
LineIndent writes a formatted string followed by a newline to stdout. Output is word wrapped, and terminated by a newline. All lines after the first are indented by indent number of spaces (in addition to the indenting enforced by this UI instance.