cli

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: May 3, 2026 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ExitOK          = 0
	ExitError       = 1 // general error
	ExitSkip        = 2 // no match found (e.g. lore show with zero results)
	ExitUserError   = 3 // bad arguments, invalid input
	ExitConfigError = 4 // configuration file error
)

Exit codes for the lore CLI, following Unix conventions. Used by cmd/root.go and commands that need non-zero exits.

Variables

This section is empty.

Functions

func ExitCodeFrom

func ExitCodeFrom(err error) int

ExitCodeFrom returns the exit code if err is (or wraps) an *ExitCodeError, or -1 otherwise.

Types

type ExitCodeError

type ExitCodeError struct {
	Code int
}

ExitCodeError is returned by commands that need a specific exit code without calling os.Exit directly (enables testability).

func (*ExitCodeError) Error

func (e *ExitCodeError) Error() string

Jump to

Keyboard shortcuts

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