Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrSendTargetValidationFailed is returned if a send target can't pass a // validation. ErrSendTargetValidationFailed = errors.New("send target validation failed") // ErrCantSendEvent is returned if event can't be sent. ErrCantSendEvent = errors.New("can't send event") )
var ErrCantBePresented = errors.New("can't be presented")
ErrCantBePresented is returned if data can't be presented.
var ErrUnsupportedOutputMode = errors.New("unsupported mode")
ErrUnsupportedOutputMode is returned if user passed a unsupported output mode.
Functions ¶
This section is empty.
Types ¶
type Cmd ¶
type Cmd struct {
// contains filtered or unexported fields
}
Cmd represents a command line application entrypoint.
func (*Cmd) ExecuteWithOptions ¶
func (c *Cmd) ExecuteWithOptions(options ...CommandOption) error
ExecuteWithOptions will execute the application with the provided options.
type CommandOption ¶
CommandOption is used to configure a command in Cmd.ExecuteWithOptions.
func WithArgs ¶
func WithArgs(args ...string) CommandOption
WithArgs creates an option which sets args.
func WithOutput ¶
func WithOutput(out io.Writer) CommandOption
WithOutput creates an option witch sets os.Stdout and os.Stderr.
type TestingCmd ¶
type TestingCmd struct {
*Cmd
}
TestingCmd a wrapper for Cmd to ease of testing.
func (*TestingCmd) Args ¶
func (c *TestingCmd) Args(args ...string)
Args set to main command to be executed.
func (*TestingCmd) Execute ¶
func (c *TestingCmd) Execute() error
Execute the command and return error if any.
func (*TestingCmd) ExecuteOrFail ¶
func (c *TestingCmd) ExecuteOrFail()
ExecuteOrFail the command or fail on error.
func (*TestingCmd) Exit ¶
func (c *TestingCmd) Exit(fn func(code int))
Exit sets the exit command that accepts retcode.