Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
DefaultCmder = &LocalCmder{}
)
Functions ¶
func PrettyCommand ¶
PrettyCommand takes arguments identical to Cmder.Command, it returns a pretty printed command that could be pasted into a shell
Types ¶
type Cmd ¶
type Cmd interface { // Run executes the command (like os/exec.Cmd.Run) // It returns a *RunError if there is any error, nil otherwise Run() *RunError // WithEnv sets the Env variables for the Cmd // Each entry should be of the form "key=value" WithEnv(...string) Cmd // WithStdin sets the io.Reader used for stdin WithStdin(reader io.Reader) Cmd // WithStdout sets the io.Writer used for stdout WithStdout(io.Writer) Cmd // WithStderr sets the io.Reader used for stderr WithStderr(io.Writer) Cmd }
Cmd abstracts over running a command somewhere
type LocalCmd ¶
LocalCmd wraps os/exec.Cmd, implementing the cmdutils.Cmd interface
func (*LocalCmd) Run ¶
Run runs the command If the returned error is non-nil, it should be of type *RunError
func (*LocalCmd) WithStderr ¶
WithStderr sets stderr
type RunError ¶
type RunError struct {
// contains filtered or unexported fields
}
RunError represents an error running a Cmd
func (*RunError) OutputString ¶
func (*RunError) PrettyCommand ¶
PrettyCommand pretty prints the command in a way that could be pasted into a shell
Click to show internal directories.
Click to hide internal directories.