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 ¶
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
Click to show internal directories.
Click to hide internal directories.