Documentation ¶
Index ¶
- func Context(c *gc.C) *cmd.Context
- func ContextForDir(c *gc.C, dir string) *cmd.Context
- func InitCommand(c cmd.Command, args []string) error
- func NewFlagSet() *gnuflag.FlagSet
- func RunCommand(c *gc.C, com cmd.Command, args ...string) (*cmd.Context, error)
- func RunCommandInDir(c *gc.C, com cmd.Command, args []string, dir string) (*cmd.Context, error)
- func Stderr(ctx *cmd.Context) string
- func Stdout(ctx *cmd.Context) string
- func TestInit(c *gc.C, com cmd.Command, args []string, errPat string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Context ¶
Context creates a simple command execution context with the current dir set to a newly created directory within the test directory.
func ContextForDir ¶
ContextForDir creates a simple command execution context with the current dir set to the specified directory.
func InitCommand ¶
InitCommand will create a new flag set, and call the Command's SetFlags and Init methods with the appropriate args.
func NewFlagSet ¶
NewFlagSet creates a new flag set using the standard options, particularly the option to stop the gnuflag methods from writing to StdErr or StdOut.
func RunCommand ¶
RunCommand runs a command with the specified args. The returned error may come from either the parsing of the args, the command initialisation, or the actual running of the command. Access to the resulting output streams is provided through the returned context instance.
func RunCommandInDir ¶
RunCommandInDir works like RunCommand, but runs with a context that uses dir.
func Stderr ¶
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.
Types ¶
This section is empty.