command

package
v2.1.1 Latest Latest
Warning

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

Go to latest
Published: May 1, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Abort

func Abort(details AbortDetails)

func AbortIfError

func AbortIfError(preamble string, err error)

func AbortIfErrors

func AbortIfErrors(preamble string, errors []error)

func AbortWith

func AbortWith(format string, args ...interface{})

func AbortWithUsage

func AbortWithUsage(format string, args ...interface{})

Types

type AbortDetails

type AbortDetails struct {
	ExitCode  int
	Error     error
	EmitUsage bool
}

type Command

type Command struct {
	Name          string
	Flags         types.GinkgoFlagSet
	Usage         string
	ShortDoc      string
	Documentation string
	DocLink       string
	Command       func(args []string, additionalArgs []string)
}

func (Command) EmitUsage

func (c Command) EmitUsage(writer io.Writer)

func (Command) Run

func (c Command) Run(args []string, additionalArgs []string)

type DeprecatedCommand

type DeprecatedCommand struct {
	Name        string
	Deprecation types.Deprecation
}

type Program

type Program struct {
	Name               string
	Heading            string
	Commands           []Command
	DefaultCommand     Command
	DeprecatedCommands []DeprecatedCommand

	//For testing - leave as nil in production
	OutWriter io.Writer
	ErrWriter io.Writer
	Exiter    func(code int)
}

func (Program) EmitUsage

func (p Program) EmitUsage(writer io.Writer)

func (Program) RunAndExit

func (p Program) RunAndExit(osArgs []string)

Jump to

Keyboard shortcuts

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