cmd

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CmdOutput

func CmdOutput(name string, args []string) string

func GitOutput

func GitOutput(name string, args []string) string

func GitOutputs

func GitOutputs(name string, args []string) []string

Types

type BasicCmd

type BasicCmd struct {
	Name   string
	Args   []string
	Stdin  *os.File
	Stdout *os.File
	Stderr *os.File
}

func NewBasicCmd

func NewBasicCmd(cmd string) *BasicCmd

func (*BasicCmd) CombinedOutput

func (cmd *BasicCmd) CombinedOutput() (string, error)

func (*BasicCmd) SetCmd

func (cmd *BasicCmd) SetCmd(name string) Cmd

func (*BasicCmd) Spawn

func (cmd *BasicCmd) Spawn() error

func (*BasicCmd) WithArg

func (cmd *BasicCmd) WithArg(arg string) Cmd

func (*BasicCmd) WithArgs

func (cmd *BasicCmd) WithArgs(args ...string) Cmd

type Cmd

type Cmd interface {
	SetCmd(name string) Cmd
	WithArg(arg string) Cmd
	WithArgs(args ...string) Cmd
	CombinedOutput() (string, error)
	Spawn() error
}

type MockCmd

type MockCmd struct {
	Name string
	Args []string
}

func NewMockCmd

func NewMockCmd(cmd string) *MockCmd

func (*MockCmd) CombinedOutput

func (cmd *MockCmd) CombinedOutput() (string, error)

func (*MockCmd) SetCmd

func (cmd *MockCmd) SetCmd(name string) Cmd

func (*MockCmd) Spawn

func (cmd *MockCmd) Spawn() error

func (*MockCmd) WithArg

func (cmd *MockCmd) WithArg(arg string) Cmd

func (*MockCmd) WithArgs

func (cmd *MockCmd) WithArgs(args ...string) Cmd

Jump to

Keyboard shortcuts

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