Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Base ¶
type Base struct { Verbose bool `arg:"-v" help:"display full errors"` // contains filtered or unexported fields }
Base provides the base logic to detect and run commands. It must be embedded in your root command struct.
func (*Base) Errorf ¶
Errorf is provided for compatibility with testify/require, it will print the errors to stderr. Unless verbose is set, testify messages are detected and shortened to the message line only.
func (*Base) ExecCommand ¶ added in v0.2.0
ExecCommand wraps exec.Command, to enable mocking during unit tests
func (*Base) FailNow ¶
func (o *Base) FailNow()
FailNow is provided for compatibility with testify/require, a panic will trigger an exit with code 1
type Owl ¶
type Owl interface { Errorf(format string, args ...interface{}) ExecCommand(name string, arg ...string) *exec.Cmd FailNow() IsVerbose() bool Printf(format string, a ...interface{}) Println(a ...interface{}) }
Owl provides helpers for your commands, see Base for documentation. Commands can cast it to your root type to access global options.
type ShellAliases ¶ added in v0.2.0
type ShellAliases struct {
ShellAliases *shellAliasesCmd `arg:"subcommand:build-shell-aliases" help:"generate shell aliases for all subcommands"`
}
ShellAliases registers a build-shell-aliases subcommand that auto-generates shell aliases for all active subcommands.