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
Trace bool // Print composed command before execution.
TraceWriter io.Writer // Where to write the trace output.
}
Cmd represents a command to be executed, with options to control its behavior. The Cmd struct embeds the standard library's exec.Cmd, adding additional fields to control the command's output and tracing.
func Command ¶
Command creates a new Cmd struct with the given name and arguments. It looks up the absolute path of the executable using execabs.LookPath, and sets up the Cmd with the necessary environment and output streams. The Cmd is configured to trace the command execution by setting Trace to true and TraceWriter to os.Stdout.
Click to show internal directories.
Click to hide internal directories.