cmdutil

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCancel = errors.New("ErrCancel")

ErrCancel signals user-initiated cancellation; it maps to its own exit code.

View Source
var ErrSilent = errors.New("ErrSilent")

ErrSilent signals exit code 1 without printing anything. Use it when the subcommand has already printed its own error message.

Functions

func FlagErrorWrap

func FlagErrorWrap(err error) error

FlagErrorWrap returns a FlagError wrapping err.

func FlagErrorf

func FlagErrorf(format string, args ...any) error

FlagErrorf returns a FlagError wrapping fmt.Errorf(format, args...).

func IsUserCancellation

func IsUserCancellation(err error) bool

IsUserCancellation reports whether err represents the user aborting the command. Interactive integrations that add their own interrupt errors should extend this.

Types

type Factory

type Factory struct {
	IOStreams *iostreams.IOStreams
}

type FlagError

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

A FlagError indicates a problem parsing flags or arguments; such errors cause the command's usage to be shown.

func (*FlagError) Error

func (e *FlagError) Error() string

func (*FlagError) Unwrap

func (e *FlagError) Unwrap() error

Jump to

Keyboard shortcuts

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