command

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2023 License: MPL-2.0 Imports: 26 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

View Source
const (
	// Command line flag names
	FlagPort     = "port"
	FlagHTTPAddr = "http-addr"

	FlagCAPath     = "ca-path"
	FlagCACert     = "ca-cert"
	FlagClientCert = "client-cert"
	FlagClientKey  = "client-key"
	FlagSSLVerify  = "ssl-verify"

	FlagAutoApprove = "auto-approve"
)

Variables

This section is empty.

Functions

func Commands

func Commands(writer io.Writer, errorWriter io.Writer) 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