Documentation ¶
Overview ¶
Package execz builds on stdlib os/exec.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Cmd ¶
type Cmd struct { // Stdin is the command's stdin. If nil, [os.Stdin] is used. Stdin io.Reader // Stdout is the command's stdout. If nil, [os.Stdout] is used. Stdout io.Writer // Stderr is the command's stderr. If nil, [os.Stderr] is used. Stderr io.Writer // Name is the executable name, e.g. "pg_dump". Name string // Label is a human-readable label for the command, e.g. "@sakila: dump". // If empty, [Cmd.Name] is used. Label string // ErrPrefix is the prefix to use for error messages. ErrPrefix string // UsesOutputFile indicates that the command its output to this filepath // instead of stdout. If empty, stdout is being used. UsesOutputFile string // Args is the set of args to the command. Args []string // Env is the set of environment variables to set for the command. Env []string // NoProgress indicates that progress messages should not be output. NoProgress bool // ProgressFromStderr indicates that the command outputs progress messages // on stderr. ProgressFromStderr bool // CmdDirPath controls whether the command's PATH will include the parent dir // of the command. This allows the command to access sibling commands in the // same dir, e.g. "pg_dumpall" needs to invoke "pg_dump". CmdDirPath bool }
Cmd represents an external command being prepared or run.
func (*Cmd) LogValue ¶
LogValue implements slog.LogValuer. It redacts sensitive information (passwords etc.) from URL-like values.
func (*Cmd) String ¶
String returns what command would look like if executed in a shell. Note that the returned string could contain sensitive information such as passwords, so it's not safe for logging. Instead, see Cmd.LogValue.
Click to show internal directories.
Click to hide internal directories.