Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CmdOptions ¶
type CmdOptions struct {
Command string // Command to run.
Args []string // Command arguments.
Dir string // Working directory.
}
CmdOptions respresents options to create a process.
type Command ¶
Command respresents command to launch.
func NewCommand ¶
func NewCommand(ctx context.Context, opts CmdOptions) *Command
NewCommand returns new command with context `ctx` and options `opts`.
func (*Command) PipeStderrTo ¶
PipeStderrTo pipes Stderr to Stdin of `to`.
func (*Command) PipeStdoutTo ¶
PipeStdoutTo pipes Stdout to Stdin of `to`.
type ReadCloser ¶
ReadCloser implements io.ReadCloser.
type Result ¶
type Result struct {
DoneOk bool // Process exited successfully?
StartOk bool // Process started successfully?
ExitCode int // Exit code.
Output string // Captured output.
}
Result respresents process run result.
type StartOptions ¶
type StartOptions struct {
ScanStdout bool // Scan for Stdout (Capture + Print)?
ScanStderr bool // Scan for Stderr (Capture + Print)?
Print bool // Print output?
Capture bool // Build buffer and capture output into Result.Output?
Wait bool // Wait for program to finish?
Encoding *charmap.Charmap // Endoding.
NewConsole bool // Spawn new console window on Windows?
Hide bool // Try to hide process window on Windows?
OnChar func(c string, p *os.Process) // Callback for each character.
OnLine func(l string, p *os.Process) // Callback for each line.
}
StartOptions respresents options to start a process.
Directories
¶
| Path | Synopsis |
|---|---|
|
examples
|
|
|
windows/script
command
|
|
|
windows/shell-command
command
|
|
|
windows/shell-command-stdin
command
|
|
|
windows/shell-commands-pipe
command
|
Click to show internal directories.
Click to hide internal directories.