Documentation
¶
Index ¶
- func DefaultEnv() map[string]string
- func IsTTY() bool
- func New(v *validator.Validate, opts ...commandOption) (*command, error)
- func ParseCommand(str string) (string, []string, map[string]string, error)
- func SetQuietMode(val bool)
- func WithArgs(args []string) commandOption
- func WithCmd(c string) commandOption
- func WithCwd(cwd string) commandOption
- func WithEnv(env map[string]string) commandOption
- func WithFileOutput(fp string) commandOption
- func WithInheritedEnv() commandOption
- func WithLineColor(color *color.Color) commandOption
- func WithLinePrefix(prefix string) commandOption
- func WithLinePrefixFn(fn func() string) commandOption
- func WithProcessGroup() commandOption
- func WithStderr(fw io.Writer) commandOption
- func WithStdin(fw io.Reader) commandOption
- func WithStdout(fw io.Writer) commandOption
- func WithTTYAwareEnv(env map[string]string) commandOption
- func WithTTYAwareStdin() commandOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultEnv ¶
func SetQuietMode ¶
func SetQuietMode(val bool)
SetQuietMode is a global variable that will control the entire output of this package until set otherwise. If set to true, we write all logs to io.Discard, instead of stderr/stdout.
func WithArgs ¶
func WithArgs(args []string) commandOption
WithArgs sets the arguments passed to the commands
func WithFileOutput ¶
func WithFileOutput(fp string) commandOption
func WithInheritedEnv ¶
func WithInheritedEnv() commandOption
WithInheritedEnv automatically inherits the existing environment
func WithLineColor ¶
func WithLinePrefix ¶
func WithLinePrefix(prefix string) commandOption
func WithLinePrefixFn ¶
func WithLinePrefixFn(fn func() string) commandOption
func WithProcessGroup ¶
func WithProcessGroup() commandOption
func WithTTYAwareEnv ¶
WithTTYAwareEnv combines WithInheritedEnv with additional environment variables
func WithTTYAwareStdin ¶
func WithTTYAwareStdin() commandOption
WithTTYAwareStdin sets stdin based on TTY detection
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.