Help us shape the future of Go! Take the 2026 Go Developer Survey

cmd

package
v0.45.1 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2026 License: Apache-2.0 Imports: 69 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute() error

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

func ExitCode added in v0.45.0

func ExitCode(err error) int

ExitCode returns the process exit code for an error returned by Execute: the error's own code if it carries one, otherwise 1.

func GetDebug

func GetDebug() bool

GetDebug returns the debug flag value

func GetVerbose

func GetVerbose() bool

GetVerbose returns the verbose flag value

func Reported added in v0.45.0

func Reported(err error) bool

Reported reports whether the command has already explained this failure, so that main prints nothing further and only sets the exit code.

Types

type ExitCodeError added in v0.45.0

type ExitCodeError struct {
	Code int
	Err  error
	// Reported says the command has already explained the failure to the user,
	// so main should take the exit code and print nothing more. For a failure
	// whose explanation is itself the output — `vinculum man` answering an
	// ambiguous topic with the commands that resolve it — a trailing
	// "Error: ..." line restates the headline and buries the answer.
	Reported bool
}

ExitCodeError carries a specific process exit code out of a command, for callers that distinguish failure modes (`vinculum schema` uses 1 for a validation failure and 2 for a usage or I/O error).

func (*ExitCodeError) Error added in v0.45.0

func (e *ExitCodeError) Error() string

func (*ExitCodeError) Unwrap added in v0.45.0

func (e *ExitCodeError) Unwrap() error

Jump to

Keyboard shortcuts

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