execute

package module
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cmd

type Cmd struct {
	*exec.Cmd

	OutBuffer bytes.Buffer
	ErrBuffer bytes.Buffer
	// contains filtered or unexported fields
}

Cmd add some attributes on exec.Cmd

func New

func New(name string, arg ...string) *Cmd

New create a execute.Cmd

func (*Cmd) ErrString

func (cmd *Cmd) ErrString() string

ErrString get the stderr as string

func (*Cmd) ErrStringHistory

func (cmd *Cmd) ErrStringHistory() []string

ErrStringHistory get stderr history access by ErrStringNext

func (*Cmd) ErrStringNext

func (cmd *Cmd) ErrStringNext() string

ErrStringNext get unused stderr

func (*Cmd) ExitCode

func (cmd *Cmd) ExitCode() int

ExitCode get the exit code

func (*Cmd) Hide

func (cmd *Cmd) Hide() *Cmd

Hide does nothing on non Windows platforms

func (*Cmd) OutString

func (cmd *Cmd) OutString() string

OutString get the stdout as string

func (*Cmd) OutStringHistory

func (cmd *Cmd) OutStringHistory() []string

OutStringHistory get stdout history access by OutStringNext

func (*Cmd) OutStringNext

func (cmd *Cmd) OutStringNext() string

OutStringNext get unused stdout

func (*Cmd) RawArgf added in v0.1.1

func (cmd *Cmd) RawArgf(format string, content ...interface{}) *Cmd

RawArgf does nothing on non Windows platforms

func (*Cmd) Run added in v0.1.1

func (cmd *Cmd) Run() (*Cmd, error)

Run starts the command and waits for it to complete

func (*Cmd) RunToFile

func (cmd *Cmd) RunToFile(path string) (*Cmd, error)

RunToFile run and store output to file

func (*Cmd) Start added in v0.1.1

func (cmd *Cmd) Start() (*Cmd, error)

Start starts the command but does not wait for it to complete

func (*Cmd) Wait

func (cmd *Cmd) Wait() (*Cmd, error)

Wait waits for the command to exit

func (*Cmd) WorkDir

func (cmd *Cmd) WorkDir() string

WorkDir get the working directory

Jump to

Keyboard shortcuts

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