cmd

package
v0.0.0-...-c4ad8bf Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Version = "dev"

Version is set at build time via ldflags; defaults to "dev".

Functions

func Execute

func Execute() int

Execute runs the root command and returns the appropriate exit code. It maps errors to exit codes per SPEC §19.

func ExecuteAndGetExitCode

func ExecuteAndGetExitCode(args []string) (output string, exitCode int)

ExecuteAndGetExitCode runs the root command with the given args and returns the output and the mapped exit code.

func ExecuteWithArgs

func ExecuteWithArgs(args []string) (string, error)

ExecuteWithArgs is used for testing: it sets custom args on the root command and captures all output. Returns the output string and the error.

func ExecuteWithArgsAndInput

func ExecuteWithArgsAndInput(args []string, input *bytes.Buffer) (string, error)

ExecuteWithArgsAndInput is used for testing commands that read from stdin.

func PrintError

func PrintError(err error)

PrintError prints an error message to stderr, respecting the quiet flag.

Types

type GlobalOpts

type GlobalOpts struct {
	Output  string
	Limit   int
	All     bool
	Marker  string
	Profile string
	Verbose bool
	Quiet   bool
}

GlobalOpts holds the values of all global persistent flags.

var Opts GlobalOpts

Opts is the package-level GlobalOpts populated by PersistentPreRun.

Jump to

Keyboard shortcuts

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