cli

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2026 License: MIT Imports: 38 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	ExitOK       = 0
	ExitFailure  = 1 // unexpected internal error
	ExitUsage    = 2 // bad flags, bad config, missing path
	ExitProblems = 3 // doctor found problems
)

Exit codes. Scripts and hooks can rely on these staying stable.

Variables

View Source
var Version = "dev"

Version is set via ldflags at build time.

Functions

func Execute

func Execute() error

Execute runs the root command.

func ExitCode added in v0.5.0

func ExitCode(err error) int

ExitCode maps an error returned by Execute to a process exit code.

Types

type ExitError added in v0.5.0

type ExitError struct {
	Code int
	Err  error
}

ExitError carries a specific exit code out of a command.

func (*ExitError) Error added in v0.5.0

func (e *ExitError) Error() string

func (*ExitError) Unwrap added in v0.5.0

func (e *ExitError) Unwrap() error

Jump to

Keyboard shortcuts

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