cmdemu

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: May 22, 2023 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Overview

Package cmdemu provides a way to emulate an external command from test code.

Index

Constants

View Source
const ExitFailure = 1
View Source
const ExitSuccess = 0
View Source
const ExitUnavailable = 69

Something does not work, but the exact reason is not known.

View Source
const ExitUsage = 64

The command was used incorrectly, e.g., with the wrong number of arguments, a bad flag, a bad syntax in a parameter, or whatever.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	Name    string
	Execute func(args []string) error
}

func (*Command) MakeArgs

func (c *Command) MakeArgs(args ...string) []string

type ExitCodeError

type ExitCodeError int

func (ExitCodeError) Code

func (e ExitCodeError) Code() int

func (ExitCodeError) Error

func (e ExitCodeError) Error() string

type TestingM

type TestingM interface {
	Run() int
}

type Wrapper

type Wrapper struct {
	// contains filtered or unexported fields
}

func New

func New(fs *flag.FlagSet) *Wrapper

func (*Wrapper) Main

func (w *Wrapper) Main(m TestingM) int

func (*Wrapper) Register

func (w *Wrapper) Register(cmd Command)

Jump to

Keyboard shortcuts

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