{"modulePath":"github.com/micro/cli","version":"v0.2.0","isLatest":true,"isStandardLibrary":false,"goos":"linux","goarch":"amd64","docs":"# package cli\n\nPackage cli provides a minimal framework for creating and organizing command line Go applications. cli is designed to be easy to understand and write, the most simple cli application can be written as follows:\n\n\tfunc main() {\n\t  cli.NewApp().Run(os.Args)\n\t}\n\nOf course this application does not do much, so let's make this an actual application:\n\n\tfunc main() {\n\t  app := cli.NewApp()\n\t  app.Name = \"greet\"\n\t  app.Usage = \"say a greeting\"\n\t  app.Action = func(c *cli.Context) error {\n\t    println(\"Greetings\")\n\t    return nil\n\t  }\n\n\t  app.Run(os.Args)\n\t}\n\n## Variables\n\n```go\nvar AppHelpTemplate = `NAME:\n   {{.Name}}{{if .Usage}} - {{.Usage}}{{end}}\n\nUSAGE:\n   {{if .UsageText}}{{.UsageText}}{{else}}{{.HelpName}} {{if .VisibleFlags}}[global options]{{end}}{{if .Commands}} command [command options]{{end}} {{if .ArgsUsage}}{{.ArgsUsage}}{{else}}[arguments...]{{end}}{{end}}{{if .Version}}{{if not .HideVersion}}\n\nVERSION:\n   {{.Version}}{{end}}{{end}}{{if .Description}}\n\nDESCRIPTION:\n   {{.Description}}{{end}}{{if len .Authors}}\n\nAUTHOR{{with $length := len .Authors}}{{if ne 1 $length}}S{{end}}{{end}}:\n   {{range $index, $author := .Authors}}{{if $index}}\n   {{end}}{{$author}}{{end}}{{end}}{{if .VisibleCommands}}\n\nCOMMANDS:{{range .VisibleCategories}}{{if .Name}}\n   {{.Name}}:{{end}}{{range .VisibleCommands}}\n     {{join .Names \", \"}}{{\"\\t\"}}{{.Usage}}{{end}}{{end}}{{end}}{{if .VisibleFlags}}\n\nGLOBAL OPTIONS:\n   {{range $index, $option := .VisibleFlags}}{{if $index}}\n   {{end}}{{$option}}{{end}}{{end}}{{if .Copyright}}\n\nCOPYRIGHT:\n   {{.Copyright}}{{end}}\n`\n```\nAppHelpTemplate is the text template for the Default help topic. cli.go uses text/template to render templates. You can render custom help text by setting this variable.\n\n```go\nvar CommandHelpTemplate = `NAME:\n   {{.HelpName}} - {{.Usage}}\n\nUSAGE:\n   {{if .UsageText}}{{.UsageText}}{{else}}{{.HelpName}}{{if .VisibleFlags}} [command options]{{end}} {{if .ArgsUsage}}{{.ArgsUsage}}{{else}}[arguments...]{{end}}{{end}}{{if .Category}}\n\nCATEGORY:\n   {{.Category}}{{end}}{{if .Description}}\n\nDESCRIPTION:\n   {{.Description}}{{end}}{{if .VisibleFlags}}\n\nOPTIONS:\n   {{range .VisibleFlags}}{{.}}\n   {{end}}{{end}}\n`\n```\nCommandHelpTemplate is the text template for the command help topic. cli.go uses text/template to render templates. You can render custom help text by setting this variable.\n\n```go\nvar ErrWriter io.Writer = os.Stderr\n```\nErrWriter is used to write errors to the user. This can be anything implementing the io.Writer interface and defaults to os.Stderr.\n\n```go\nvar HelpPrinter helpPrinter = printHelp\n```\nHelpPrinter is a function that writes the help output. If not set a default is used. The function signature is: func(w io.Writer, templ string, data interface{})\n\n```go\nvar HelpPrinterCustom helpPrinterCustom = printHelpCustom\n```\nHelpPrinterCustom is same as HelpPrinter but takes a custom function for template function map.\n\n```go\nvar OsExiter = os.Exit\n```\nOsExiter is the function used when the app exits. If not set defaults to os.Exit.\n\n```go\nvar SubcommandHelpTemplate = `NAME:\n   {{.HelpName}} - {{if .Description}}{{.Description}}{{else}}{{.Usage}}{{end}}\n\nUSAGE:\n   {{if .UsageText}}{{.UsageText}}{{else}}{{.HelpName}} command{{if .VisibleFlags}} [command options]{{end}} {{if .ArgsUsage}}{{.ArgsUsage}}{{else}}[arguments...]{{end}}{{end}}\n\nCOMMANDS:{{range .VisibleCategories}}{{if .Name}}\n   {{.Name}}:{{end}}{{range .VisibleCommands}}\n     {{join .Names \", \"}}{{\"\\t\"}}{{.Usage}}{{end}}\n{{end}}{{if .VisibleFlags}}\nOPTIONS:\n   {{range .VisibleFlags}}{{.}}\n   {{end}}{{end}}\n`\n```\nSubcommandHelpTemplate is the text template for the subcommand help topic. cli.go uses text/template to render templates. You can render custom help text by setting this variable.\n\n```go\nvar VersionPrinter = printVersion\n```\nVersionPrinter prints the version for the App\n\n## Functions\n\n```go\nfunc DefaultAppComplete(c *Context)\n```\nDefaultAppComplete prints the list of subcommands as the default app completion method\n\n```go\nfunc HandleAction(action interface{}, context *Context) (err error)\n```\nHandleAction attempts to figure out which Action signature was used.  If it's an ActionFunc or a func with the legacy signature for Action, the func is run!\n\n```go\nfunc HandleExitCoder(err error)\n```\nHandleExitCoder checks if the error fulfills the ExitCoder interface, and if so prints the error to stderr (if it is non-empty) and calls OsExiter with the given exit code.  If the given error is a MultiError, then this func is called on all members of the Errors slice and calls OsExiter with the last exit code.\n\n```go\nfunc ShowAppHelp(c *Context) (err error)\n```\nShowAppHelp is an action that displays the help.\n\n```go\nfunc ShowAppHelpAndExit(c *Context, exitCode int)\n```\nShowAppHelpAndExit - Prints the list of subcommands for the app and exits with exit code.\n\n```go\nfunc ShowCommandCompletions(ctx *Context, command string)\n```\nShowCommandCompletions prints the custom completions for a given command\n\n```go\nfunc ShowCommandHelp(ctx *Context, command string) error\n```\nShowCommandHelp prints help for the given command\n\n```go\nfunc ShowCommandHelpAndExit(c *Context, command string, code int)\n```\nShowCommandHelpAndExit - exits with code after showing help\n\n```go\nfunc ShowCompletions(c *Context)\n```\nShowCompletions prints the lists of commands within a given context\n\n```go\nfunc ShowSubcommandHelp(c *Context) error\n```\nShowSubcommandHelp prints help for the given subcommand\n\n```go\nfunc ShowVersion(c *Context)\n```\nShowVersion prints the version number of the App\n\n## Types\n\n```go\ntype ActionFunc func(*Context) error\n```\nActionFunc is the action to execute when no subcommands are specified\n\n```go\ntype AfterFunc func(*Context) error\n```\nAfterFunc is an action to execute after any subcommands are run, but after the subcommand has finished it is run even if Action() panics\n\n```go\ntype App struct {\n\t// The name of the program. Defaults to path.Base(os.Args[0])\n\tName string\n\t// Full name of command for help, defaults to Name\n\tHelpName string\n\t// Description of the program.\n\tUsage string\n\t// Text to override the USAGE section of help\n\tUsageText string\n\t// Description of the program argument format.\n\tArgsUsage string\n\t// Version of the program\n\tVersion string\n\t// Description of the program\n\tDescription string\n\t// List of commands to execute\n\tCommands []Command\n\t// List of flags to parse\n\tFlags []Flag\n\t// Boolean to enable bash completion commands\n\tEnableBashCompletion bool\n\t// Boolean to hide built-in help command\n\tHideHelp bool\n\t// Boolean to hide built-in version flag and the VERSION section of help\n\tHideVersion bool\n\n\t// An action to execute when the bash-completion flag is set\n\tBashComplete BashCompleteFunc\n\t// An action to execute before any subcommands are run, but after the context is ready\n\t// If a non-nil error is returned, no subcommands are run\n\tBefore BeforeFunc\n\t// An action to execute after any subcommands are run, but after the subcommand has finished\n\t// It is run even if Action() panics\n\tAfter AfterFunc\n\n\t// The action to execute when no subcommands are specified\n\t// Expects a `cli.ActionFunc` but will accept the *deprecated* signature of `func(*cli.Context) {}`\n\t// *Note*: support for the deprecated `Action` signature will be removed in a future version\n\tAction interface{}\n\n\t// Execute this function if the proper command cannot be found\n\tCommandNotFound CommandNotFoundFunc\n\t// Execute this function if an usage error occurs\n\tOnUsageError OnUsageErrorFunc\n\t// Compilation date\n\tCompiled time.Time\n\t// List of all authors who contributed\n\tAuthors []Author\n\t// Copyright of the binary if any\n\tCopyright string\n\t// Name of Author (Note: Use App.Authors, this is deprecated)\n\tAuthor string\n\t// Email of Author (Note: Use App.Authors, this is deprecated)\n\tEmail string\n\t// Writer writer to write output to\n\tWriter io.Writer\n\t// ErrWriter writes error output\n\tErrWriter io.Writer\n\t// Other custom info\n\tMetadata map[string]interface{}\n\t// Carries a function which returns app specific info.\n\tExtraInfo func() map[string]string\n\t// CustomAppHelpTemplate the text template for app help topic.\n\t// cli.go uses text/template to render templates. You can\n\t// render custom help text by setting this variable.\n\tCustomAppHelpTemplate string\n\t// contains filtered or unexported fields\n}\n```\nApp is the main structure of a cli application. It is recommended that an app be created with the cli.NewApp() function\n\n```go\nfunc NewApp() *App\n```\nNewApp creates a new cli Application with some reasonable defaults for Name, Usage, Version and Action.\n\n```go\nfunc (a *App) Categories() CommandCategories\n```\nCategories returns a slice containing all the categories with the commands they contain\n\n```go\nfunc (a *App) Command(name string) *Command\n```\nCommand returns the named command on App. Returns nil if the command does not exist\n\n```go\nfunc (a *App) Run(arguments []string) (err error)\n```\nRun is the entry point to the cli app. Parses the arguments slice and routes to the proper flag/args combination\n\n```go\nfunc (a *App) RunAndExitOnError()\n```\nRunAndExitOnError calls .Run() and exits non-zero if an error was returned\n\nDeprecated: instead you should return an error that fulfills cli.ExitCoder to cli.App.Run. This will cause the application to exit with the given eror code in the cli.ExitCoder\n\n```go\nfunc (a *App) RunAsSubcommand(ctx *Context) (err error)\n```\nRunAsSubcommand invokes the subcommand given the context, parses ctx.Args() to generate command-specific flags\n\n```go\nfunc (a *App) Setup()\n```\nSetup runs initialization code to ensure all data structures are ready for \\`Run\\` or inspection prior to \\`Run\\`.  It is internally called by \\`Run\\`, but will return early if setup has already happened.\n\n```go\nfunc (a *App) VisibleCategories() []*CommandCategory\n```\nVisibleCategories returns a slice of categories and commands that are Hidden=false\n\n```go\nfunc (a *App) VisibleCommands() []Command\n```\nVisibleCommands returns a slice of the Commands with Hidden=false\n\n```go\nfunc (a *App) VisibleFlags() []Flag\n```\nVisibleFlags returns a slice of the Flags with Hidden=false\n\n```go\ntype Args []string\n```\nArgs contains apps console arguments\n\n```go\nfunc (a Args) First() string\n```\nFirst returns the first argument, or else a blank string\n\n```go\nfunc (a Args) Get(n int) string\n```\nGet returns the nth argument, or else a blank string\n\n```go\nfunc (a Args) Present() bool\n```\nPresent checks if there are any arguments present\n\n```go\nfunc (a Args) Swap(from, to int) error\n```\nSwap swaps arguments at the given indexes\n\n```go\nfunc (a Args) Tail() []string\n```\nTail returns the rest of the arguments (not the first one) or else an empty string slice\n\n```go\ntype Author struct {\n\tName  string // The Authors name\n\tEmail string // The Authors email\n}\n```\nAuthor represents someone who has contributed to a cli project.\n\n```go\nfunc (a Author) String() string\n```\nString makes Author comply to the Stringer interface, to allow an easy print in the templating process\n\n```go\ntype BashCompleteFunc func(*Context)\n```\nBashCompleteFunc is an action to execute when the bash-completion flag is set\n\n```go\ntype BeforeFunc func(*Context) error\n```\nBeforeFunc is an action to execute before any subcommands are run, but after the context is ready if a non-nil error is returned, no subcommands are run\n\n```go\ntype BoolFlag struct {\n\tName        string\n\tUsage       string\n\tEnvVar      string\n\tHidden      bool\n\tDestination *bool\n}\n```\nBoolFlag is a flag with type bool\n\n```go\nfunc (f BoolFlag) Apply(set *flag.FlagSet)\n```\nApply populates the flag given the flag set and environment Ignores errors\n\n```go\nfunc (f BoolFlag) ApplyWithError(set *flag.FlagSet) error\n```\nApplyWithError populates the flag given the flag set and environment\n\n```go\nfunc (f BoolFlag) GetName() string\n```\nGetName returns the name of the flag\n\n```go\nfunc (f BoolFlag) String() string\n```\nString returns a readable representation of this value (for usage defaults)\n\n```go\ntype BoolTFlag struct {\n\tName        string\n\tUsage       string\n\tEnvVar      string\n\tHidden      bool\n\tDestination *bool\n}\n```\nBoolTFlag is a flag with type bool that is true by default\n\n```go\nfunc (f BoolTFlag) Apply(set *flag.FlagSet)\n```\nApply populates the flag given the flag set and environment Ignores errors\n\n```go\nfunc (f BoolTFlag) ApplyWithError(set *flag.FlagSet) error\n```\nApplyWithError populates the flag given the flag set and environment\n\n```go\nfunc (f BoolTFlag) GetName() string\n```\nGetName returns the name of the flag\n\n```go\nfunc (f BoolTFlag) String() string\n```\nString returns a readable representation of this value (for usage defaults)\n\n```go\ntype Command struct {\n\t// The name of the command\n\tName string\n\t// short name of the command. Typically one character (deprecated, use `Aliases`)\n\tShortName string\n\t// A list of aliases for the command\n\tAliases []string\n\t// A short description of the usage of this command\n\tUsage string\n\t// Custom text to show on USAGE section of help\n\tUsageText string\n\t// A longer explanation of how the command works\n\tDescription string\n\t// A short description of the arguments of this command\n\tArgsUsage string\n\t// The category the command is part of\n\tCategory string\n\t// The function to call when checking for bash command completions\n\tBashComplete BashCompleteFunc\n\t// An action to execute before any sub-subcommands are run, but after the context is ready\n\t// If a non-nil error is returned, no sub-subcommands are run\n\tBefore BeforeFunc\n\t// An action to execute after any subcommands are run, but after the subcommand has finished\n\t// It is run even if Action() panics\n\tAfter AfterFunc\n\t// The function to call when this command is invoked\n\tAction interface{}\n\n\t// Execute this function if a usage error occurs.\n\tOnUsageError OnUsageErrorFunc\n\t// List of child commands\n\tSubcommands Commands\n\t// List of flags to parse\n\tFlags []Flag\n\t// Treat all flags as normal arguments if true\n\tSkipFlagParsing bool\n\t// Skip argument reordering which attempts to move flags before arguments,\n\t// but only works if all flags appear after all arguments. This behavior was\n\t// removed n version 2 since it only works under specific conditions so we\n\t// backport here by exposing it as an option for compatibility.\n\tSkipArgReorder bool\n\t// Boolean to hide built-in help command\n\tHideHelp bool\n\t// Boolean to hide this command from help or completion\n\tHidden bool\n\n\t// Full name of command for help, defaults to full command name, including parent commands.\n\tHelpName string\n\n\t// CustomHelpTemplate the text template for the command help topic.\n\t// cli.go uses text/template to render templates. You can\n\t// render custom help text by setting this variable.\n\tCustomHelpTemplate string\n\t// contains filtered or unexported fields\n}\n```\nCommand is a subcommand for a cli.App.\n\n```go\nfunc (c Command) FullName() string\n```\nFullName returns the full name of the command. For subcommands this ensures that parent commands are part of the command path\n\n```go\nfunc (c Command) HasName(name string) bool\n```\nHasName returns true if Command.Name or Command.ShortName matches given name\n\n```go\nfunc (c Command) Names() []string\n```\nNames returns the names including short names and aliases.\n\n```go\nfunc (c Command) Run(ctx *Context) (err error)\n```\nRun invokes the command given the context, parses ctx.Args() to generate command-specific flags\n\n```go\nfunc (c Command) VisibleFlags() []Flag\n```\nVisibleFlags returns a slice of the Flags with Hidden=false\n\n```go\ntype CommandCategories []*CommandCategory\n```\nCommandCategories is a slice of \\*CommandCategory.\n\n```go\nfunc (c CommandCategories) AddCommand(category string, command Command) CommandCategories\n```\nAddCommand adds a command to a category.\n\n```go\nfunc (c CommandCategories) Len() int\n```\n\n```go\nfunc (c CommandCategories) Less(i, j int) bool\n```\n\n```go\nfunc (c CommandCategories) Swap(i, j int)\n```\n\n```go\ntype CommandCategory struct {\n\tName     string\n\tCommands Commands\n}\n```\nCommandCategory is a category containing commands.\n\n```go\nfunc (c *CommandCategory) VisibleCommands() []Command\n```\nVisibleCommands returns a slice of the Commands with Hidden=false\n\n```go\ntype CommandNotFoundFunc func(*Context, string)\n```\nCommandNotFoundFunc is executed if the proper command cannot be found\n\n```go\ntype Commands []Command\n```\nCommands is a slice of Command\n\n```go\ntype CommandsByName []Command\n```\n\n```go\nfunc (c CommandsByName) Len() int\n```\n\n```go\nfunc (c CommandsByName) Less(i, j int) bool\n```\n\n```go\nfunc (c CommandsByName) Swap(i, j int)\n```\n\n```go\ntype Context struct {\n\tApp     *App\n\tCommand Command\n\t// contains filtered or unexported fields\n}\n```\nContext is a type that is passed through to each Handler action in a cli application. Context can be used to retrieve context-specific Args and parsed command-line options.\n\n```go\nfunc NewContext(app *App, set *flag.FlagSet, parentCtx *Context) *Context\n```\nNewContext creates a new context. For use in when invoking an App or Command action.\n\n```go\nfunc (c *Context) Args() Args\n```\nArgs returns the command line arguments associated with the context.\n\n```go\nfunc (c *Context) Bool(name string) bool\n```\nBool looks up the value of a local BoolFlag, returns false if not found\n\n```go\nfunc (c *Context) BoolT(name string) bool\n```\nBoolT looks up the value of a local BoolTFlag, returns false if not found\n\n```go\nfunc (c *Context) Duration(name string) time.Duration\n```\nDuration looks up the value of a local DurationFlag, returns 0 if not found\n\n```go\nfunc (c *Context) FlagNames() (names []string)\n```\nFlagNames returns a slice of flag names used in this context.\n\n```go\nfunc (c *Context) Float64(name string) float64\n```\nFloat64 looks up the value of a local Float64Flag, returns 0 if not found\n\n```go\nfunc (c *Context) Generic(name string) interface{}\n```\nGeneric looks up the value of a local GenericFlag, returns nil if not found\n\n```go\nfunc (c *Context) GlobalBool(name string) bool\n```\nGlobalBool looks up the value of a global BoolFlag, returns false if not found\n\n```go\nfunc (c *Context) GlobalBoolT(name string) bool\n```\nGlobalBoolT looks up the value of a global BoolTFlag, returns false if not found\n\n```go\nfunc (c *Context) GlobalDuration(name string) time.Duration\n```\nGlobalDuration looks up the value of a global DurationFlag, returns 0 if not found\n\n```go\nfunc (c *Context) GlobalFlagNames() (names []string)\n```\nGlobalFlagNames returns a slice of global flag names used by the app.\n\n```go\nfunc (c *Context) GlobalFloat64(name string) float64\n```\nGlobalFloat64 looks up the value of a global Float64Flag, returns 0 if not found\n\n```go\nfunc (c *Context) GlobalGeneric(name string) interface{}\n```\nGlobalGeneric looks up the value of a global GenericFlag, returns nil if not found\n\n```go\nfunc (c *Context) GlobalInt(name string) int\n```\nGlobalInt looks up the value of a global IntFlag, returns 0 if not found\n\n```go\nfunc (c *Context) GlobalInt64(name string) int64\n```\nGlobalInt64 looks up the value of a global Int64Flag, returns 0 if not found\n\n```go\nfunc (c *Context) GlobalInt64Slice(name string) []int64\n```\nGlobalInt64Slice looks up the value of a global Int64SliceFlag, returns nil if not found\n\n```go\nfunc (c *Context) GlobalIntSlice(name string) []int\n```\nGlobalIntSlice looks up the value of a global IntSliceFlag, returns nil if not found\n\n```go\nfunc (c *Context) GlobalIsSet(name string) bool\n```\nGlobalIsSet determines if the global flag was actually set\n\n```go\nfunc (c *Context) GlobalSet(name, value string) error\n```\nGlobalSet sets a context flag to a value on the global flagset\n\n```go\nfunc (c *Context) GlobalString(name string) string\n```\nGlobalString looks up the value of a global StringFlag, returns \"\" if not found\n\n```go\nfunc (c *Context) GlobalStringSlice(name string) []string\n```\nGlobalStringSlice looks up the value of a global StringSliceFlag, returns nil if not found\n\n```go\nfunc (c *Context) GlobalUint(name string) uint\n```\nGlobalUint looks up the value of a global UintFlag, returns 0 if not found\n\n```go\nfunc (c *Context) GlobalUint64(name string) uint64\n```\nGlobalUint64 looks up the value of a global Uint64Flag, returns 0 if not found\n\n```go\nfunc (c *Context) Int(name string) int\n```\nInt looks up the value of a local IntFlag, returns 0 if not found\n\n```go\nfunc (c *Context) Int64(name string) int64\n```\nInt64 looks up the value of a local Int64Flag, returns 0 if not found\n\n```go\nfunc (c *Context) Int64Slice(name string) []int64\n```\nInt64Slice looks up the value of a local Int64SliceFlag, returns nil if not found\n\n```go\nfunc (c *Context) IntSlice(name string) []int\n```\nIntSlice looks up the value of a local IntSliceFlag, returns nil if not found\n\n```go\nfunc (c *Context) IsSet(name string) bool\n```\nIsSet determines if the flag was actually set\n\n```go\nfunc (c *Context) NArg() int\n```\nNArg returns the number of the command line arguments.\n\n```go\nfunc (c *Context) NumFlags() int\n```\nNumFlags returns the number of flags set\n\n```go\nfunc (c *Context) Parent() *Context\n```\nParent returns the parent context, if any\n\n```go\nfunc (c *Context) Set(name, value string) error\n```\nSet sets a context flag to a value.\n\n```go\nfunc (c *Context) String(name string) string\n```\nString looks up the value of a local StringFlag, returns \"\" if not found\n\n```go\nfunc (c *Context) StringSlice(name string) []string\n```\nStringSlice looks up the value of a local StringSliceFlag, returns nil if not found\n\n```go\nfunc (c *Context) Uint(name string) uint\n```\nUint looks up the value of a local UintFlag, returns 0 if not found\n\n```go\nfunc (c *Context) Uint64(name string) uint64\n```\nUint64 looks up the value of a local Uint64Flag, returns 0 if not found\n\n```go\ntype DurationFlag struct {\n\tName        string\n\tUsage       string\n\tEnvVar      string\n\tHidden      bool\n\tValue       time.Duration\n\tDestination *time.Duration\n}\n```\nDurationFlag is a flag with type time.Duration (see [https://golang.org/pkg/time/#ParseDuration](https://golang.org/pkg/time/#ParseDuration))\n\n```go\nfunc (f DurationFlag) Apply(set *flag.FlagSet)\n```\nApply populates the flag given the flag set and environment Ignores errors\n\n```go\nfunc (f DurationFlag) ApplyWithError(set *flag.FlagSet) error\n```\nApplyWithError populates the flag given the flag set and environment\n\n```go\nfunc (f DurationFlag) GetName() string\n```\nGetName returns the name of the flag\n\n```go\nfunc (f DurationFlag) String() string\n```\nString returns a readable representation of this value (for usage defaults)\n\n```go\ntype ErrorFormatter interface {\n\tFormat(s fmt.State, verb rune)\n}\n```\n\n```go\ntype ExitCoder interface {\n\terror\n\tExitCode() int\n}\n```\nExitCoder is the interface checked by \\`App\\` and \\`Command\\` for a custom exit code\n\n```go\ntype ExitError struct {\n\t// contains filtered or unexported fields\n}\n```\nExitError fulfills both the builtin \\`error\\` interface and \\`ExitCoder\\`\n\n```go\nfunc NewExitError(message interface{}, exitCode int) *ExitError\n```\nNewExitError makes a new \\*ExitError\n\n```go\nfunc (ee *ExitError) Error() string\n```\nError returns the string message, fulfilling the interface required by \\`error\\`\n\n```go\nfunc (ee *ExitError) ExitCode() int\n```\nExitCode returns the exit code, fulfilling the interface required by \\`ExitCoder\\`\n\n```go\ntype Flag interface {\n\tfmt.Stringer\n\t// Apply Flag settings to the given flag set\n\tApply(*flag.FlagSet)\n\tGetName() string\n}\n```\nFlag is a common interface related to parsing flags in cli. For more advanced flag parsing techniques, it is recommended that this interface be implemented.\n\n```go\nvar BashCompletionFlag Flag = BoolFlag{\n\tName:   \"generate-bash-completion\",\n\tHidden: true,\n}\n```\nBashCompletionFlag enables bash-completion for all commands and subcommands\n\n```go\nvar HelpFlag Flag = BoolFlag{\n\tName:  \"help, h\",\n\tUsage: \"show help\",\n}\n```\nHelpFlag prints the help for all commands and subcommands Set to the zero value (BoolFlag{}) to disable flag -- keeps subcommand unless HideHelp is set to true)\n\n```go\nvar VersionFlag Flag = BoolFlag{\n\tName:  \"version, v\",\n\tUsage: \"print the version\",\n}\n```\nVersionFlag prints the version for the application\n\n```go\ntype FlagStringFunc func(Flag) string\n```\nFlagStringFunc is used by the help generation to display a flag, which is expected to be a single line.\n\n```go\nvar FlagStringer FlagStringFunc = stringifyFlag\n```\nFlagStringer converts a flag definition to a string. This is used by help to display a flag.\n\n```go\ntype FlagsByName []Flag\n```\nFlagsByName is a slice of Flag.\n\n```go\nfunc (f FlagsByName) Len() int\n```\n\n```go\nfunc (f FlagsByName) Less(i, j int) bool\n```\n\n```go\nfunc (f FlagsByName) Swap(i, j int)\n```\n\n```go\ntype Float64Flag struct {\n\tName        string\n\tUsage       string\n\tEnvVar      string\n\tHidden      bool\n\tValue       float64\n\tDestination *float64\n}\n```\nFloat64Flag is a flag with type float64\n\n```go\nfunc (f Float64Flag) Apply(set *flag.FlagSet)\n```\nApply populates the flag given the flag set and environment Ignores errors\n\n```go\nfunc (f Float64Flag) ApplyWithError(set *flag.FlagSet) error\n```\nApplyWithError populates the flag given the flag set and environment\n\n```go\nfunc (f Float64Flag) GetName() string\n```\nGetName returns the name of the flag\n\n```go\nfunc (f Float64Flag) String() string\n```\nString returns a readable representation of this value (for usage defaults)\n\n```go\ntype Generic interface {\n\tSet(value string) error\n\tString() string\n}\n```\nGeneric is a generic parseable type identified by a specific flag\n\n```go\ntype GenericFlag struct {\n\tName   string\n\tUsage  string\n\tEnvVar string\n\tHidden bool\n\tValue  Generic\n}\n```\nGenericFlag is a flag with type Generic\n\n```go\nfunc (f GenericFlag) Apply(set *flag.FlagSet)\n```\nApply takes the flagset and calls Set on the generic flag with the value provided by the user for parsing by the flag Ignores parsing errors\n\n```go\nfunc (f GenericFlag) ApplyWithError(set *flag.FlagSet) error\n```\nApplyWithError takes the flagset and calls Set on the generic flag with the value provided by the user for parsing by the flag\n\n```go\nfunc (f GenericFlag) GetName() string\n```\nGetName returns the name of the flag\n\n```go\nfunc (f GenericFlag) String() string\n```\nString returns a readable representation of this value (for usage defaults)\n\n```go\ntype Int64Flag struct {\n\tName        string\n\tUsage       string\n\tEnvVar      string\n\tHidden      bool\n\tValue       int64\n\tDestination *int64\n}\n```\nInt64Flag is a flag with type int64\n\n```go\nfunc (f Int64Flag) Apply(set *flag.FlagSet)\n```\nApply populates the flag given the flag set and environment Ignores errors\n\n```go\nfunc (f Int64Flag) ApplyWithError(set *flag.FlagSet) error\n```\nApplyWithError populates the flag given the flag set and environment\n\n```go\nfunc (f Int64Flag) GetName() string\n```\nGetName returns the name of the flag\n\n```go\nfunc (f Int64Flag) String() string\n```\nString returns a readable representation of this value (for usage defaults)\n\n```go\ntype Int64Slice []int64\n```\nInt64Slice is an opaque type for \\[]int to satisfy flag.Value and flag.Getter\n\n```go\nfunc (f *Int64Slice) Get() interface{}\n```\nGet returns the slice of ints set by this flag\n\n```go\nfunc (f *Int64Slice) Set(value string) error\n```\nSet parses the value into an integer and appends it to the list of values\n\n```go\nfunc (f *Int64Slice) String() string\n```\nString returns a readable representation of this value (for usage defaults)\n\n```go\nfunc (f *Int64Slice) Value() []int64\n```\nValue returns the slice of ints set by this flag\n\n```go\ntype Int64SliceFlag struct {\n\tName   string\n\tUsage  string\n\tEnvVar string\n\tHidden bool\n\tValue  *Int64Slice\n}\n```\nInt64SliceFlag is a flag with type \\*Int64Slice\n\n```go\nfunc (f Int64SliceFlag) Apply(set *flag.FlagSet)\n```\nApply populates the flag given the flag set and environment Ignores errors\n\n```go\nfunc (f Int64SliceFlag) ApplyWithError(set *flag.FlagSet) error\n```\nApplyWithError populates the flag given the flag set and environment\n\n```go\nfunc (f Int64SliceFlag) GetName() string\n```\nGetName returns the name of the flag\n\n```go\nfunc (f Int64SliceFlag) String() string\n```\nString returns a readable representation of this value (for usage defaults)\n\n```go\ntype IntFlag struct {\n\tName        string\n\tUsage       string\n\tEnvVar      string\n\tHidden      bool\n\tValue       int\n\tDestination *int\n}\n```\nIntFlag is a flag with type int\n\n```go\nfunc (f IntFlag) Apply(set *flag.FlagSet)\n```\nApply populates the flag given the flag set and environment Ignores errors\n\n```go\nfunc (f IntFlag) ApplyWithError(set *flag.FlagSet) error\n```\nApplyWithError populates the flag given the flag set and environment\n\n```go\nfunc (f IntFlag) GetName() string\n```\nGetName returns the name of the flag\n\n```go\nfunc (f IntFlag) String() string\n```\nString returns a readable representation of this value (for usage defaults)\n\n```go\ntype IntSlice []int\n```\nIntSlice is an opaque type for \\[]int to satisfy flag.Value and flag.Getter\n\n```go\nfunc (f *IntSlice) Get() interface{}\n```\nGet returns the slice of ints set by this flag\n\n```go\nfunc (f *IntSlice) Set(value string) error\n```\nSet parses the value into an integer and appends it to the list of values\n\n```go\nfunc (f *IntSlice) String() string\n```\nString returns a readable representation of this value (for usage defaults)\n\n```go\nfunc (f *IntSlice) Value() []int\n```\nValue returns the slice of ints set by this flag\n\n```go\ntype IntSliceFlag struct {\n\tName   string\n\tUsage  string\n\tEnvVar string\n\tHidden bool\n\tValue  *IntSlice\n}\n```\nIntSliceFlag is a flag with type \\*IntSlice\n\n```go\nfunc (f IntSliceFlag) Apply(set *flag.FlagSet)\n```\nApply populates the flag given the flag set and environment Ignores errors\n\n```go\nfunc (f IntSliceFlag) ApplyWithError(set *flag.FlagSet) error\n```\nApplyWithError populates the flag given the flag set and environment\n\n```go\nfunc (f IntSliceFlag) GetName() string\n```\nGetName returns the name of the flag\n\n```go\nfunc (f IntSliceFlag) String() string\n```\nString returns a readable representation of this value (for usage defaults)\n\n```go\ntype MultiError struct {\n\tErrors []error\n}\n```\nMultiError is an error that wraps multiple errors.\n\n```go\nfunc NewMultiError(err ...error) MultiError\n```\nNewMultiError creates a new MultiError. Pass in one or more errors.\n\n```go\nfunc (m MultiError) Error() string\n```\nError implements the error interface.\n\n```go\ntype OnUsageErrorFunc func(context *Context, err error, isSubcommand bool) error\n```\nOnUsageErrorFunc is executed if an usage error occurs. This is useful for displaying customized usage error messages.  This function is able to replace the original error messages.  If this function is not set, the \"Incorrect usage\" is displayed and the execution is interrupted.\n\n```go\ntype StringFlag struct {\n\tName        string\n\tUsage       string\n\tEnvVar      string\n\tHidden      bool\n\tValue       string\n\tDestination *string\n}\n```\nStringFlag is a flag with type string\n\n```go\nfunc (f StringFlag) Apply(set *flag.FlagSet)\n```\nApply populates the flag given the flag set and environment Ignores errors\n\n```go\nfunc (f StringFlag) ApplyWithError(set *flag.FlagSet) error\n```\nApplyWithError populates the flag given the flag set and environment\n\n```go\nfunc (f StringFlag) GetName() string\n```\nGetName returns the name of the flag\n\n```go\nfunc (f StringFlag) String() string\n```\nString returns a readable representation of this value (for usage defaults)\n\n```go\ntype StringSlice []string\n```\nStringSlice is an opaque type for \\[]string to satisfy flag.Value and flag.Getter\n\n```go\nfunc (f *StringSlice) Get() interface{}\n```\nGet returns the slice of strings set by this flag\n\n```go\nfunc (f *StringSlice) Set(value string) error\n```\nSet appends the string value to the list of values\n\n```go\nfunc (f *StringSlice) String() string\n```\nString returns a readable representation of this value (for usage defaults)\n\n```go\nfunc (f *StringSlice) Value() []string\n```\nValue returns the slice of strings set by this flag\n\n```go\ntype StringSliceFlag struct {\n\tName   string\n\tUsage  string\n\tEnvVar string\n\tHidden bool\n\tValue  *StringSlice\n}\n```\nStringSliceFlag is a flag with type \\*StringSlice\n\n```go\nfunc (f StringSliceFlag) Apply(set *flag.FlagSet)\n```\nApply populates the flag given the flag set and environment Ignores errors\n\n```go\nfunc (f StringSliceFlag) ApplyWithError(set *flag.FlagSet) error\n```\nApplyWithError populates the flag given the flag set and environment\n\n```go\nfunc (f StringSliceFlag) GetName() string\n```\nGetName returns the name of the flag\n\n```go\nfunc (f StringSliceFlag) String() string\n```\nString returns a readable representation of this value (for usage defaults)\n\n```go\ntype Uint64Flag struct {\n\tName        string\n\tUsage       string\n\tEnvVar      string\n\tHidden      bool\n\tValue       uint64\n\tDestination *uint64\n}\n```\nUint64Flag is a flag with type uint64\n\n```go\nfunc (f Uint64Flag) Apply(set *flag.FlagSet)\n```\nApply populates the flag given the flag set and environment Ignores errors\n\n```go\nfunc (f Uint64Flag) ApplyWithError(set *flag.FlagSet) error\n```\nApplyWithError populates the flag given the flag set and environment\n\n```go\nfunc (f Uint64Flag) GetName() string\n```\nGetName returns the name of the flag\n\n```go\nfunc (f Uint64Flag) String() string\n```\nString returns a readable representation of this value (for usage defaults)\n\n```go\ntype UintFlag struct {\n\tName        string\n\tUsage       string\n\tEnvVar      string\n\tHidden      bool\n\tValue       uint\n\tDestination *uint\n}\n```\nUintFlag is a flag with type uint\n\n```go\nfunc (f UintFlag) Apply(set *flag.FlagSet)\n```\nApply populates the flag given the flag set and environment Ignores errors\n\n```go\nfunc (f UintFlag) ApplyWithError(set *flag.FlagSet) error\n```\nApplyWithError populates the flag given the flag set and environment\n\n```go\nfunc (f UintFlag) GetName() string\n```\nGetName returns the name of the flag\n\n```go\nfunc (f UintFlag) String() string\n```\nString returns a readable representation of this value (for usage defaults)\n\n","path":"github.com/micro/cli","name":"cli","synopsis":"Package cli provides a minimal framework for creating and organizing command line Go applications.","isRedistributable":true}
