command

package
v7.2.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2018 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetDebug

func SetDebug(value bool)

SetDebug sets whether or not we are in debug mode

Types

type Command

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

Command runs commands on the command line

func New

func New(command ...string) *Command

New creates a new Command instance

func (*Command) Err

func (r *Command) Err() error

Err returns the error that this command encountered. Runs the command if it hasn't so far.

func (*Command) Output

func (r *Command) Output() string

Output returns the output of this command. Runs if it hasn't so far.

func (*Command) OutputContainsLine

func (r *Command) OutputContainsLine(line string) bool

OutputContainsLine returns whether the output of this command contains the given line

func (*Command) OutputContainsText

func (r *Command) OutputContainsText(text string) bool

OutputContainsText returns whether the output of this command contains the given text

func (*Command) Run

func (r *Command) Run()

Run runs this command. Doesn't run again if it ran already. Stores the outcome in fields of the instance.

func (Command) String

func (r Command) String() string

Jump to

Keyboard shortcuts

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