cmd

package
v0.0.0-...-508dbe3 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2026 License: MIT Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute() error

Execute runs the root command. Invocation failures come back wrapped in UsageError so the caller can pick the exit status.

func IsUsageError

func IsUsageError(err error) bool

IsUsageError reports whether err was caused by the invocation rather than by the command's work.

func NewUsageError

func NewUsageError(err error) error

NewUsageError wraps err as an invocation error. It returns nil for a nil error so that `return NewUsageError(validate())` cannot turn success into a failure with exit status 2.

Types

type UsageError

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

UsageError marks a failure caused by how the command was invoked rather than by the work it tried to do. The entry point maps it to exit status 2 so scripts can tell a misspelled flag from a failed optimization run.

func (*UsageError) Error

func (e *UsageError) Error() string

func (*UsageError) Unwrap

func (e *UsageError) Unwrap() error

Jump to

Keyboard shortcuts

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