package
0.2.2
Repository: https://github.com/opsani/cli.git
Documentation: pkg.go.dev

# Functions

Args is a convenience function that converts a variadic list of strings into an array.
ArgsS is a convenience function that converts a space delimited string into an array of args.
ExecuteInInteractiveConsole runs a pair of functions connected in an interactive virtual terminal environment.
ExecuteInInteractiveConsoleT runs a test within an interactive console environment Execution requires a standard test instance, a pair of functions that execute the code under test and the test code, and any desired options for configuring the virtual terminal environment The raw ouytput and the terminal state are logged in the event of a test failure.
NewCommandExecutor returns an executor for testing Cobra commands.
NewInteractiveCommandExecutor returns a new command executor for working with interactive terminal commands.
NewInteractiveCommandTester returns a new command executor for working with interactive terminal commands.
NewPassthroughPipeFile returns a new PassthroughPipeFile that wraps the input file to enable read deadline support.
TempConfigFileWithBytes returns a temporary YAML config file with the given byte array content.
TempConfigFileWithObj returns a temporary YAML config file with the given object serialized to YAML.
TempConfigFileWithString returns a temporary YAML config file with the given string content.

# Structs

CommandExecutor provides an interface for executing Cobra commands in tests.
InteractiveCommandExecutor executes a Cobra command interactively within a virtual terminal The command executor orchestrates an underlying expect.Console and vt10x.VT virtual terminal and executes the target command within the environment.
InteractiveCommandTester instances are yielded while executing a command via ExecuteCommandInteractively and provide information about the virtual terminal execution environment.
InteractiveExecutionContext describes the state of an interactive terminal execution.
InteractiveTestContext instances are vended when an interactive test is run.
PassthroughPipeFile wraps a file with a PassthroughPipe to add read deadline support.
Suite provides a single struct for importing all testing functionality with sensible defaults with disambiguated names designed to read clearly in test cases.

# Type aliases

InteractiveProcessFunc instances are functions that represent the process side of an interactive terminal.
InteractiveUserFunc iinstances are functions that represent the user side of an interactive terminal.