package
3.1.1
Repository: https://github.com/juju/cmd.git
Documentation: pkg.go.dev

# Functions

Context creates a simple command execution context with the current dir set to a newly created directory within the test directory.
ContextForDir creates a simple command execution context with the current dir set to the specified directory.
HelpText returns a command's formatted help text.
InitCommand will create a new flag set, and call the Command's SetFlags and Init methods with the appropriate args.
NewFlagSet creates a new flag set using the standard options, particularly the option to stop the gnuflag methods from writing to StdErr or StdOut.
NewPrompter returns an io.ReadWriter implementation that calls the given function every time Read is called after some text has been written or if all the previously returned text has been read.
NewSeqPrompter returns a prompter that can be used to check a sequence of IO interactions.
RunCommand runs a command with the specified args.
RunCommandInDir works like RunCommand, but runs with a context that uses dir.
RunCommandWithContext runs the command asynchronously with the specified context and returns a channel which providers the command's errors.
Stderr takes a command Context that we assume has been created in this package, and gets the content of the Stderr buffer as a string.
Stdout takes a command Context that we assume has been created in this package, and gets the content of the Stdout buffer as a string.
TestInit checks that a command initialises correctly with the given set of arguments.

# Structs

Prompter is designed to be used in a cmd.Context to check interactive request-response sequences using stdin and stdout.
No description provided by the author