Documentation
¶
Index ¶
- type ArgOpt
- func BoolFlag(key string, b bool) ArgOpt
- func Combine(opts ...ArgOpt) ArgOpt
- func Env(key, value string) ArgOpt
- func EnvIf(key, value string) ArgOpt
- func Extra(key, value string) ArgOpt
- func ExtraIf(key, value string) ArgOpt
- func Flag(key, value string) ArgOpt
- func FlagIf(key, value string) ArgOpt
- func Noop() ArgOpt
- func Positional(values ...string) ArgOpt
- func SetIf(fn func(k, v string) ArgOpt, key, value string) ArgOpt
- func When(b bool, opt ArgOpt) ArgOpt
- type Args
- type CLIExecutor
- type Command
- type CommandFlag
- type Executor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArgOpt ¶
type ArgOpt func(args *Args)
ArgOpt is a functional option setting fields within Args once executed.
func Positional ¶
type Args ¶
type Args struct { // Extra flags one can pass to a go command wrapper. Extra map[string]string // Environment variables to set when calling a go command. Environment map[string]string // Flags sets the CLI flags to be passed Flags []CommandFlag // Positional configured positional arguments Positional []string }
Args holds parameters, environment variables and flag information used to pass to the go tool.
func CreateArgs ¶
func (*Args) GetExtraDefault ¶
GetExtraDefault reads a value from 'extra' fields. Returns 'd' if the key is missing.
type CLIExecutor ¶
type CLIExecutor struct {
// contains filtered or unexported fields
}
CLIExecutor runs a command with arguments using the os.Exec function.
func NewCLIExecutor ¶
func NewCLIExecutor(verbose bool) *CLIExecutor
func (*CLIExecutor) ExecCollectOutput ¶
type CommandFlag ¶
Click to show internal directories.
Click to hide internal directories.