command

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2021 License: MPL-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ExitCodeOK int = 0

	ExitCodeError = 10 + iota
	ExitCodeInterrupt
	ExitCodeRequiredFlagsError
	ExitCodeParseFlagsError
	ExitCodeConfigError
	ExitCodeDriverError
)

Exit codes are int values that represent an exit code for a particular error. Sub-systems may check this unique error to determine the cause of an error without parsing the output or help text.

Errors start at 10

Variables

This section is empty.

Functions

func Commands

func Commands() map[string]cli.CommandFactory

Commands returns the mapping of CLI commands for CTS. The meta parameter lets you set meta options for all commands.

Types

type CLI

type CLI struct {
	sync.Mutex
	// contains filtered or unexported fields
}

CLI is the main entry point.

func NewCLI

func NewCLI(out, err io.Writer) *CLI

NewCLI creates a new CLI object with the given stdout and stderr streams.

func (*CLI) Run

func (cli *CLI) Run(args []string) int

Run accepts a slice of arguments and returns an int representing the exit status from the command.

Jump to

Keyboard shortcuts

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