Documentation
¶
Index ¶
- Variables
- func SetLogger(l Logger)
- type Logger
- type Option
- func WithDir(dir string) Option
- func WithEnv(env ...string) Option
- func WithOutputCommand(command string, dest *string) Option
- func WithPTY(rows, cols uint16) Option
- func WithPassthrough() Option
- func WithQuiet() Option
- func WithShell() Option
- func WithStdin(r io.Reader) Option
- func WithStreamHandler(h func(io.Reader)) Option
- type Runner
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrEmptyCommand = errors.New("empty command")
)
Functions ¶
Types ¶
type Logger ¶
type Logger interface {
Debug(args ...any)
}
Logger is the minimal logging interface used by the package
type Option ¶
type Option func(*options)
Option configures command execution
func WithOutputCommand ¶
WithOutputCommand adds a second command to capture extra output. The second command's result is written to dest.
func WithPTY ¶
WithPTY runs the command in a pseudo-tty with the given window size. Used for commands that show interactive progress.
func WithPassthrough ¶
func WithPassthrough() Option
WithPassthrough routes stdout/stderr directly to the console
func WithQuiet ¶
func WithQuiet() Option
WithQuiet suppresses console output even if the runner is verbose
func WithShell ¶
func WithShell() Option
WithShell runs the command via bash -c (for pipes and special characters)
func WithStreamHandler ¶
WithStreamHandler registers a stdout stream handler.
Click to show internal directories.
Click to hide internal directories.