package command

import "github.com/onsi/ginkgo/v2/ginkgo/command"

Index

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)

Source Files

abort.go command.go program.go

Version
v2.9.2
Published
Mar 23, 2023
Platform
js/wasm
Imports
6 packages
Last checked
2 hours ago

Tools for package owners.