Versions in this module Expand all Collapse all v0 v0.14.0 Mar 22, 2025 Changes in this version + var DefaultCmder = &LocalCmder + func CombinedOutputLines(cmd Cmd) (lines []string, err error) + func Output(cmd Cmd) ([]byte, error) + func OutputLines(cmd Cmd) (lines []string, err error) + func PrettyCommand(name string, args ...string) string + func RunWithStdinWriter(cmd Cmd, writerFunc func(io.Writer) error) error + func RunWithStdoutReader(cmd Cmd, readerFunc func(io.Reader) error) error + func WithCmd(ctx context.Context, cmdr Cmd) context.Context + func WithCmder(ctx context.Context, cmdr Cmder) context.Context + type Cmd interface + Run func() error + SetEnv func(...string) Cmd + SetStderr func(io.Writer) Cmd + SetStdin func(io.Reader) Cmd + SetStdout func(io.Writer) Cmd + func Command(command string, args ...string) Cmd + func CommandContext(ctx context.Context, command string, args ...string) Cmd + func FromContextCmd(ctx context.Context) (cmdr Cmd) + func InheritOutput(cmd Cmd) Cmd + type Cmder interface + Command func(string, ...string) Cmd + CommandContext func(context.Context, string, ...string) Cmd + func FromContextCmder(ctx context.Context) (cmdr Cmder) + type LocalCmd struct + func (cmd *LocalCmd) Run() error + func (cmd *LocalCmd) SetEnv(env ...string) Cmd + func (cmd *LocalCmd) SetStderr(w io.Writer) Cmd + func (cmd *LocalCmd) SetStdin(r io.Reader) Cmd + func (cmd *LocalCmd) SetStdout(w io.Writer) Cmd + type LocalCmder struct + func (c *LocalCmder) Command(name string, arg ...string) Cmd + func (c *LocalCmder) CommandContext(ctx context.Context, name string, arg ...string) Cmd + type NoOpCmd struct + Args []string + Command string + Context context.Context + Envs []string + Stderr io.Writer + Stdin io.Reader + Stdout io.Writer + func (no *NoOpCmd) Run() error + func (no *NoOpCmd) SetEnv(envs ...string) Cmd + func (no *NoOpCmd) SetStderr(stderr io.Writer) Cmd + func (no *NoOpCmd) SetStdin(stdin io.Reader) Cmd + func (no *NoOpCmd) SetStdout(stdout io.Writer) Cmd + type NoOpCmder struct + func (n *NoOpCmder) Command(cmd string, args ...string) Cmd + func (n *NoOpCmder) CommandContext(ctx context.Context, cmd string, args ...string) Cmd + type RunError struct + Command []string + Inner error + Output []byte + func RunErrorForError(err error) *RunError + func (e *RunError) Cause() error + func (e *RunError) Error() string + func (e *RunError) PrettyCommand() string