Documentation
¶
Overview ¶
Package pterm cmd/skywire-cli/cliutil/pterm/pterm.go c5-cli-util
The ANSI colors and box-drawing tree the CLI used from github.com/pterm/pterm, with the same output. pterm's keyboard dependency does not build for js.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Red = func(a ...interface{}) string { return sgr("31", a...) } Green = func(a ...interface{}) string { return sgr("32", a...) } Blue = func(a ...interface{}) string { return sgr("34", a...) } Cyan = func(a ...interface{}) string { return sgr("36", a...) } Magenta = func(a ...interface{}) string { return sgr("35", a...) } Yellow = func(a ...interface{}) string { return sgr("33", a...) } White = func(a ...interface{}) string { return sgr("37", a...) } Black = func(a ...interface{}) string { return sgr("30", a...) } )
Sprint-style color functions.
View Source
var ( BgRed = Style{"41"} BgBlue = Style{"44"} BgMagenta = Style{"45"} )
Background styles.
View Source
var DefaultTree = TreePrinter{}
DefaultTree is the zero-config tree printer.
Functions ¶
Types ¶
type LeveledListItem ¶
LeveledListItem is one indentation-leveled line.
type Style ¶ added in v1.3.101
type Style struct {
// contains filtered or unexported fields
}
Style is a background style; its Sprint wraps arguments in the SGR code.
type TreePrinter ¶ added in v1.3.101
type TreePrinter struct {
// contains filtered or unexported fields
}
TreePrinter renders a TreeNode with gray box-drawing branches.
func (*TreePrinter) Render ¶ added in v1.3.101
func (t *TreePrinter) Render() error
Render prints the tree and a blank line.
func (*TreePrinter) Srender ¶ added in v1.3.101
func (t *TreePrinter) Srender() string
Srender returns the rendered tree.
func (TreePrinter) WithRoot ¶ added in v1.3.101
func (t TreePrinter) WithRoot(n TreeNode) *TreePrinter
WithRoot returns a printer for the given root.
Click to show internal directories.
Click to hide internal directories.