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 ¶
IsUsageError reports whether err was caused by the invocation rather than by the command's work.
func NewUsageError ¶
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
Click to show internal directories.
Click to hide internal directories.