Documentation ¶
Index ¶
- type App
- func (a *App) AddCommand(c Command) *App
- func (a *App) AddCommands(cs []Command) *App
- func (a *App) AddFlag(f Flag) *App
- func (a *App) AddFlags(fs []Flag) *App
- func (a *App) Clear()
- func (a *App) Name() string
- func (a *App) Run(arguments []string) error
- func (a *App) RunOSArgs() error
- func (a *App) Version() string
- type Command
- type CommandAction
- type Context
- func (c *Context) Print(a ...interface{}) string
- func (c *Context) Println(a ...interface{}) string
- func (c *Context) ShowAppHelp() error
- func (c *Context) ShowCommandHelp(command string) error
- func (c *Context) ShowSubcommandHelp() error
- func (c *Context) Sprint(a ...interface{}) string
- func (c *Context) Sprintf(format string, a ...interface{}) string
- func (c *Context) Sprintln(a ...interface{}) string
- type ExitCoder
- type ExitError
- type Flag
- type FlagAction
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct { App *cli.App Action CommandAction // contains filtered or unexported fields }
App is the main structure of a cli application
func (*App) AddCommand ¶
AddCommand add a child Command to list of child Commands
func (*App) AddCommands ¶
AddCommands add an array of child Commands to list of child Commands
type Command ¶
type Command struct { Command cli.Command Action CommandAction // contains filtered or unexported fields }
Command is a subcommand for a cli.App
func (*Command) AddSubCommand ¶
AddSubCommand add a child Command to list of child Commands
func (*Command) AddSubCommands ¶
AddSubCommands add an array of child Commands to list of child Commands
type CommandAction ¶
CommandAction the function for Command action
type Context ¶
func NewContext ¶
func (*Context) ShowAppHelp ¶
func (*Context) ShowCommandHelp ¶
func (*Context) ShowSubcommandHelp ¶
type ExitError ¶
var BreakExit *ExitError = &ExitError{ ExitError: *cli.NewExitError("break", 0), }
BreakExit just for break action of command execute
func NewExitError ¶
NewExitError makes a new *ExitError with error and code
func NewExitStringError ¶
NewExitStringError makes a new *ExitError with string and code
type Flag ¶
type Flag struct { Flag cli.Flag FlagName string Action FlagAction }
Flag is a common interface related to parsing flags in cli.
type FlagAction ¶
FlagAction the function for Flag action