cli

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 18, 2026 License: EUPL-1.2 Imports: 3 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Blank

func Blank()
Example
buffer := core.NewBuffer()
SetStdout(buffer)
Blank()

func Context

func Context() context.Context
Example
_ = Context()

func Err

func Err(format string, args ...any) core.Result
Example
_ = Err("%s", "value")

func Exit

func Exit(code int, err any) core.Result
Example
_ = Exit(2, core.NewError("value"))

func Print

func Print(format string, args ...any)
Example
buffer := core.NewBuffer()
SetStdout(buffer)
Print("%s", "value")

func SetStderr

func SetStderr(w io.Writer)
Example
buffer := core.NewBuffer()
SetStderr(buffer)
_ = Err("%s", "value")

func SetStdout

func SetStdout(w io.Writer)
Example
buffer := core.NewBuffer()
SetStdout(buffer)
Print("%s", "value")

func Text

func Text(text string)
Example
buffer := core.NewBuffer()
SetStdout(buffer)
Text("value")

func Wrap

func Wrap(cause any, message string) core.Result
Example
_ = Wrap(core.NewError("cause"), "context")

func WrapVerb

func WrapVerb(cause any, verb, subject string) core.Result
Example
_ = WrapVerb(core.NewError("cause"), "read", "file")

Types

type ExitError

type ExitError struct {
	Code int
	Err  error
}

func (*ExitError) Error

func (e *ExitError) Error() string
Example
err := &ExitError{Code: 2, Err: core.NewError("value")}
_ = err.Error()

type Style

type Style struct{}
var (
	TitleStyle   Style
	ValueStyle   Style
	SuccessStyle Style
	ErrorStyle   Style
	DimStyle     Style
	RepoStyle    Style
)

func (Style) Render

func (Style) Render(text string) string
Example
style := Style{}
_ = style.Render("value")

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL