Documentation
¶
Index ¶
- func FlagTypeFromVariations(variations map[string]*any) (model.FlagType, error)
- func LegacyWarner() *legacy.Warner
- func LegacyWarnerTo(logger func() *slog.Logger) *legacy.Warner
- func PrintFatal(printer *pterm.PrefixPrinter, exit func(int), err error)
- func PrintFatalAndExit(err error)
- type Level
- type Output
- type OutputLine
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FlagTypeFromVariations ¶
func LegacyWarner ¶
LegacyWarner returns the Warner of a CLI command: the use of a legacy name is logged once, through the default logger of the process.
func LegacyWarnerTo ¶
LegacyWarnerTo is LegacyWarner with the logger it writes to: logger is called for every warning, so a default logger replaced after the warner was built is still honoured.
func PrintFatal ¶
func PrintFatal(printer *pterm.PrefixPrinter, exit func(int), err error)
PrintFatal prints err with printer, then calls exit with the code 1. The printer and the exit function are parameters so that the callers that must not stop the process (tests) can pass their own.
func PrintFatalAndExit ¶
func PrintFatalAndExit(err error)
PrintFatalAndExit prints err as an error and exits the process with the code 1.