command

package
v2.53.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 9, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecuteCmd

func ExecuteCmd(cmd *root.CmdRoot, cmdArgs interface{}, opts ...ExecuteOptions) error

func ExecuteCmdWithOutputs

func ExecuteCmdWithOutputs(cmd *root.CmdRoot, cmdArgs interface{}, opts ...ExecuteOptions) (stdout string, stderr string, err error)

func ExecuteCmdWithStandardOutput

func ExecuteCmdWithStandardOutput(cmd *root.CmdRoot, cmdArgs interface{}, opts ...ExecuteOptions) (stdout string, err error)

func NewMockCommand

func NewMockCommand() *root.CmdRoot

func ParseShellEnv

func ParseShellEnv(in string) map[string]string

Types

type ExecuteOptions

type ExecuteOptions func(*root.CmdRoot) error

func WithCaptureStdErr

func WithCaptureStdErr(w io.Writer) ExecuteOptions

func WithCaptureStdOut

func WithCaptureStdOut(w io.Writer) ExecuteOptions

func WithEmptyEnv

func WithEmptyEnv(t *testing.T) ExecuteOptions

func WithEnv

func WithEnv(t *testing.T, env map[string]string) ExecuteOptions

func WithOSStdIn

func WithOSStdIn(t *testing.T, v string) ExecuteOptions

func WithSensitiveLogging added in v2.53.0

func WithSensitiveLogging(t *testing.T, v bool) ExecuteOptions

WithSensitiveLogging controls the hiding of sensitive information in the logs and dry run output

func WithSessionEncryption added in v2.53.0

func WithSessionEncryption(t *testing.T, v bool) ExecuteOptions

WithSessionEncryption sets whether session data should be encrypted or not

func WithSetting added in v2.53.0

func WithSetting(t *testing.T, key string, value any) ExecuteOptions

WithSetting sets a configuration setting of a given key, and translates it to the equivalent environment variable The env variable value is restored at the end of the test

func WithStdIn

func WithStdIn(v string) ExecuteOptions

func WithStderrTTY

func WithStderrTTY(v bool) ExecuteOptions

func WithStdinTTY

func WithStdinTTY(v bool) ExecuteOptions

func WithStdoutTTY

func WithStdoutTTY(v bool) ExecuteOptions

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL