cmd

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2020 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CommandWithDefaults

func CommandWithDefaults(c *cobra.Command) *cobra.Command

CommandWithDefaults overwrites default values in the given command.

func ExitErrorf

func ExitErrorf(code ExitCode, format string, args ...interface{}) error

ExitErrorf formats and error message along with the ExitCode.

func NewGetCommand

func NewGetCommand() *cobra.Command

NewGetCommand returns a new "get" command tree.

func NewRootCommand

func NewRootCommand() *cobra.Command

NewRootCommand represents the base command when called without any subcommands

func NewRunCommand

func NewRunCommand() *cobra.Command

NewRunCommand returns a command ro run a test case.

Types

type ExitCode

type ExitCode int

ExitCode is a process exit code suitable for use with os.Exit.

const (
	// EX_FAIL is an exit code indicating an unspecified error.
	EX_FAIL ExitCode = 1 //nolint(golint)

	// EX_USAGE is an exit code indicating invalid invocation syntax.
	EX_USAGE ExitCode = 65 //nolint(golint)

	// EX_NOINPUT is an exit code indicating missing input data.
	EX_NOINPUT ExitCode = 66 //nolint(golint)

	// EX_DATAERR means the input data was incorrect in some
	// way.  This should only be used for user's data and not
	// system files.
	EX_DATAERR ExitCode = 65 //nolint(golint)
)

type ExitError

type ExitError struct {
	Code ExitCode
	Err  error
}

ExitError captures an ExitCode and its associated error message.

func (ExitError) Error

func (e ExitError) Error() string

Jump to

Keyboard shortcuts

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