cliutil

package
v0.0.18 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WrapStatusError

func WrapStatusError(err error) error

Types

type CLI

type CLI interface {
	Streams

	SetQuiet(bool)

	// Regular print to stdout.
	PrintOut(string, ...any)

	// Regular print to stderr.
	PrintErr(string, ...any)

	// Print to stderr unless quiet else - discard.
	PrintAux(string, ...any)
}

func NewCLI

func NewCLI(cin io.ReadCloser, cout io.Writer, cerr io.Writer) CLI

type StatusError

type StatusError struct {
	// contains filtered or unexported fields
}

func NewStatusError

func NewStatusError(code int, format string, a ...any) StatusError

func (StatusError) Code

func (e StatusError) Code() int

func (StatusError) Error

func (e StatusError) Error() string

type Streams

type Streams interface {
	InputStream() *streams.In
	OutputStream() *streams.Out
	AuxStream() *streams.Out // ErrorStream unless quiet else io.Discard
	ErrorStream() io.Writer
}

Jump to

Keyboard shortcuts

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