Documentation ¶
Index ¶
- type ActionFn
- type App
- func (app *App) AddCommands(commands ...*Command)
- func (app *App) AddFlags(flags ...*Flag)
- func (app *App) SetActionFunc(actionFn ActionFn)
- func (app *App) SetBeforeFunc(beforeFn func() error)
- func (app *App) SetError(write io.Writer)
- func (app *App) SetOutput(write io.Writer)
- func (app *App) SetUsage(usage string)
- func (app *App) SetVersion(version string)
- type Command
- type Flag
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct {
*cli.App
}
App is a wrapper of cli.App
func (*App) AddCommands ¶
AddCommands adds subcommands
func (*App) SetActionFunc ¶
SetActionFunc sets the Action function for the cli.App The action to execute when no subcommands are specified.
func (*App) SetBeforeFunc ¶
SetBeforeFunc sets the Before fucntion for the cli.App An action to execute before any subcommands are run, but after the context is ready.
func (*App) SetVersion ¶
SetVersion sets version of the program.
type Command ¶
type Command struct {
cli.Command
}
Command is a wrapper of cli.Command
func (*Command) AddSubcommands ¶
AddSubcommands adds subcommands
func (*Command) SetActionFunc ¶
SetActionFunc sets the Action fucntion for the cli.Command
func (*Command) SetBeforeFunc ¶
SetBeforeFunc sets the Before fucntion for the cli.Command
type Flag ¶
type Flag struct { cli.Flag // contains filtered or unexported fields }
Flag is a wrapper of cli.Flag
func NewFlag ¶
NewFlag returns a new Flag instance. Where the `name` is a flag name and `destination` is a pointer to which the flag value will be assigned.
func (*Flag) SetAliases ¶
SetAliases sets 'Aliases' field for the cli.Flag
func (*Flag) SetEnvVars ¶
SetEnvVars sets 'EnvVars' field for the cli.Flag
func (*Flag) SetRequired ¶
SetRequired sets 'Required' field for the cli.Flag