Documentation
¶
Overview ¶
Package cli provides Zyra's colored terminal output: leveled log lines, the startup banner, timed build steps, and the route table printer used by the CLI and dev server. It has no dependencies beyond the standard library.
Index ¶
- func BuildStep(label string, fn func() error) error
- func Colorize(color, text string) string
- func Error(format string, args ...interface{})
- func Info(format string, args ...interface{})
- func LogLine(color, level, format string, args ...interface{})
- func PrintBanner(version string)
- func PrintRoutes(routes []router.Route)
- func PrintWizardHeader(title string)
- func Success(format string, args ...interface{})
- func Warn(format string, args ...interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildStep ¶
BuildStep runs fn, logging its start, and then either a timed success message or an error message if fn fails.
func Error ¶
func Error(format string, args ...interface{})
Error prints a red-colored error log line to stderr.
func Info ¶
func Info(format string, args ...interface{})
Info prints a cyan-colored informational log line.
func PrintBanner ¶
func PrintBanner(version string)
PrintBanner prints Zyra's startup banner, sized to fit the given version string, e.g. PrintBanner("v0.1").
func PrintRoutes ¶
PrintRoutes prints a colorized startup route table.
func PrintWizardHeader ¶
func PrintWizardHeader(title string)
PrintWizardHeader prints a styled header for CLI wizards (e.g. `zyra create`).
Types ¶
This section is empty.