cmd

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RunCommandCall added in v0.4.0

type RunCommandCall struct {
	Name string
	Args []string
}

func (*RunCommandCall) String added in v0.4.0

func (c *RunCommandCall) String() string

type RunShellCommandCall added in v0.4.0

type RunShellCommandCall struct {
	CommandLine string
}

func (*RunShellCommandCall) String added in v0.4.0

func (c *RunShellCommandCall) String() string

type Runner added in v0.4.0

type Runner interface {
	RunCommand(name string, args ...string) (stdout string, stderr string, err error)
	RunShellCommand(commandLine string) (stdout string, stderr string, err error)
}

Runner can run external commands and shell commands

func NewRunner added in v0.4.0

func NewRunner() Runner

type SpyRunner added in v0.4.0

type SpyRunner struct {
	Stdout               string
	Stderr               string
	Error                error
	RunCommandCalls      []*RunCommandCall
	RunShellCommandCalls []*RunShellCommandCall
}

SpyRunner is a cmd.Runner for testing purposes

func (*SpyRunner) RunCommand added in v0.4.0

func (r *SpyRunner) RunCommand(name string, args ...string) (stdout string, stderr string, err error)

func (*SpyRunner) RunShellCommand added in v0.4.0

func (r *SpyRunner) RunShellCommand(commandLine string) (stdout string, stderr string, err error)

Jump to

Keyboard shortcuts

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