command

package
v2.5.1 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2022 License: MIT Imports: 6 Imported by: 16

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Abort

func Abort(details AbortDetails)

func AbortGracefullyWith

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

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