Versions in this module Expand all Collapse all v2 v2.1.2 Feb 4, 2020 v2.1.1 Jan 25, 2020 Changes in this version + var AppHelpTemplate = ... + var CommandHelpTemplate = ... + var ErrWriter io.Writer = os.Stderr + var FishCompletionTemplate = ... + var HelpPrinter helpPrinter = printHelp + var HelpPrinterCustom helpPrinterCustom = printHelpCustom + var MarkdownDocTemplate = ... + var OsExiter = os.Exit + var SubcommandHelpTemplate = ... + var VersionPrinter = printVersion + func DefaultAppComplete(c *Context) + func DefaultCompleteWithFlags(cmd *Command) func(c *Context) + func HandleAction(action interface{}, context *Context) (err error) + func HandleExitCoder(err error) + func ShowAppHelp(c *Context) error + func ShowAppHelpAndExit(c *Context, exitCode int) + func ShowCommandCompletions(ctx *Context, command string) + func ShowCommandHelp(ctx *Context, command string) error + func ShowCommandHelpAndExit(c *Context, command string, code int) + func ShowCompletions(c *Context) + func ShowSubcommandHelp(c *Context) error + func ShowVersion(c *Context) + type ActionFunc func(*Context) error + type AfterFunc func(*Context) error + type App struct + Action ActionFunc + After AfterFunc + ArgsUsage string + Authors []*Author + BashComplete BashCompleteFunc + Before BeforeFunc + CommandNotFound CommandNotFoundFunc + Commands []*Command + Compiled time.Time + Copyright string + CustomAppHelpTemplate string + Description string + EnableBashCompletion bool + ErrWriter io.Writer + ExitErrHandler ExitErrHandlerFunc + ExtraInfo func() map[string]string + Flags []Flag + HelpName string + HideHelp bool + HideVersion bool + Metadata map[string]interface{} + Name string + OnUsageError OnUsageErrorFunc + Usage string + UsageText string + UseShortOptionHandling bool + Version string + Writer io.Writer + func NewApp() *App + func (a *App) Command(name string) *Command + func (a *App) Run(arguments []string) (err error) + func (a *App) RunAndExitOnError() + func (a *App) RunAsSubcommand(ctx *Context) (err error) + func (a *App) RunContext(ctx context.Context, arguments []string) (err error) + func (a *App) Setup() + func (a *App) ToFishCompletion() (string, error) + func (a *App) ToMan() (string, error) + func (a *App) ToMarkdown() (string, error) + func (a *App) VisibleCategories() []CommandCategory + func (a *App) VisibleCommands() []*Command + func (a *App) VisibleFlags() []Flag + type Args interface + First func() string + Get func(n int) string + Len func() int + Present func() bool + Slice func() []string + Tail func() []string + type Author struct + Email string + Name string + func (a *Author) String() string + type BashCompleteFunc func(*Context) + type BeforeFunc func(*Context) error + type BoolFlag struct + Aliases []string + DefaultText string + Destination *bool + EnvVars []string + FilePath string + HasBeenSet bool + Hidden bool + Name string + Required bool + Usage string + Value bool + func (f *BoolFlag) Apply(set *flag.FlagSet) error + func (f *BoolFlag) GetUsage() string + func (f *BoolFlag) GetValue() string + func (f *BoolFlag) IsRequired() bool + func (f *BoolFlag) IsSet() bool + func (f *BoolFlag) Names() []string + func (f *BoolFlag) String() string + func (f *BoolFlag) TakesValue() bool + type Command struct + Action ActionFunc + After AfterFunc + Aliases []string + ArgsUsage string + BashComplete BashCompleteFunc + Before BeforeFunc + Category string + CustomHelpTemplate string + Description string + Flags []Flag + HelpName string + Hidden bool + HideHelp bool + Name string + OnUsageError OnUsageErrorFunc + SkipFlagParsing bool + Subcommands []*Command + Usage string + UsageText string + UseShortOptionHandling bool + func (c *Command) FullName() string + func (c *Command) HasName(name string) bool + func (c *Command) Names() []string + func (c *Command) Run(ctx *Context) (err error) + func (c *Command) VisibleFlags() []Flag + type CommandCategories interface + AddCommand func(category string, command *Command) + Categories func() []CommandCategory + type CommandCategory interface + Name func() string + VisibleCommands func() []*Command + type CommandNotFoundFunc func(*Context, string) + type Commands []*Command + type CommandsByName []*Command + func (c CommandsByName) Len() int + func (c CommandsByName) Less(i, j int) bool + func (c CommandsByName) Swap(i, j int) + type Context struct + App *App + Command *Command + func NewContext(app *App, set *flag.FlagSet, parentCtx *Context) *Context + func (c *Context) Args() Args + func (c *Context) Bool(name string) bool + func (c *Context) Duration(name string) time.Duration + func (c *Context) FlagNames() []string + func (c *Context) Float64(name string) float64 + func (c *Context) Float64Slice(name string) []float64 + func (c *Context) Generic(name string) interface{} + func (c *Context) Int(name string) int + func (c *Context) Int64(name string) int64 + func (c *Context) Int64Slice(name string) []int64 + func (c *Context) IntSlice(name string) []int + func (c *Context) IsSet(name string) bool + func (c *Context) Lineage() []*Context + func (c *Context) LocalFlagNames() []string + func (c *Context) NArg() int + func (c *Context) NumFlags() int + func (c *Context) Path(name string) string + func (c *Context) Set(name, value string) error + func (c *Context) String(name string) string + func (c *Context) StringSlice(name string) []string + func (c *Context) Timestamp(name string) *time.Time + func (c *Context) Uint(name string) uint + func (c *Context) Uint64(name string) uint64 + func (c *Context) Value(name string) interface{} + type DocGenerationFlag interface + GetUsage func() string + GetValue func() string + TakesValue func() bool + type DurationFlag struct + Aliases []string + DefaultText string + Destination *time.Duration + EnvVars []string + FilePath string + HasBeenSet bool + Hidden bool + Name string + Required bool + Usage string + Value time.Duration + func (f *DurationFlag) Apply(set *flag.FlagSet) error + func (f *DurationFlag) GetUsage() string + func (f *DurationFlag) GetValue() string + func (f *DurationFlag) IsRequired() bool + func (f *DurationFlag) IsSet() bool + func (f *DurationFlag) Names() []string + func (f *DurationFlag) String() string + func (f *DurationFlag) TakesValue() bool + type ErrorFormatter interface + Format func(s fmt.State, verb rune) + type ExitCoder interface + ExitCode func() int + func Exit(message interface{}, exitCode int) ExitCoder + func NewExitError(message interface{}, exitCode int) ExitCoder + type ExitErrHandlerFunc func(context *Context, err error) + type Flag interface + Apply func(*flag.FlagSet) error + IsSet func() bool + Names func() []string + var BashCompletionFlag Flag = &BoolFlag{ ... } + var HelpFlag Flag = &BoolFlag{ ... } + var VersionFlag Flag = &BoolFlag{ ... } + type FlagEnvHintFunc func(envVars []string, str string) string + var FlagEnvHinter FlagEnvHintFunc = withEnvHint + type FlagFileHintFunc func(filePath, str string) string + var FlagFileHinter FlagFileHintFunc = withFileHint + type FlagNamePrefixFunc func(fullName []string, placeholder string) string + var FlagNamePrefixer FlagNamePrefixFunc = prefixedNames + type FlagStringFunc func(Flag) string + var FlagStringer FlagStringFunc = stringifyFlag + type FlagsByName []Flag + func (f FlagsByName) Len() int + func (f FlagsByName) Less(i, j int) bool + func (f FlagsByName) Swap(i, j int) + type Float64Flag struct + Aliases []string + DefaultText string + Destination *float64 + EnvVars []string + FilePath string + HasBeenSet bool + Hidden bool + Name string + Required bool + Usage string + Value float64 + func (f *Float64Flag) Apply(set *flag.FlagSet) error + func (f *Float64Flag) GetUsage() string + func (f *Float64Flag) GetValue() string + func (f *Float64Flag) IsRequired() bool + func (f *Float64Flag) IsSet() bool + func (f *Float64Flag) Names() []string + func (f *Float64Flag) String() string + func (f *Float64Flag) TakesValue() bool + type Float64Slice struct + func NewFloat64Slice(defaults ...float64) *Float64Slice + func (f *Float64Slice) Get() interface{} + func (f *Float64Slice) Serialize() string + func (f *Float64Slice) Set(value string) error + func (f *Float64Slice) String() string + func (f *Float64Slice) Value() []float64 + type Float64SliceFlag struct + Aliases []string + DefaultText string + EnvVars []string + FilePath string + HasBeenSet bool + Hidden bool + Name string + Required bool + Usage string + Value *Float64Slice + func (f *Float64SliceFlag) Apply(set *flag.FlagSet) error + func (f *Float64SliceFlag) GetUsage() string + func (f *Float64SliceFlag) GetValue() string + func (f *Float64SliceFlag) IsRequired() bool + func (f *Float64SliceFlag) IsSet() bool + func (f *Float64SliceFlag) Names() []string + func (f *Float64SliceFlag) String() string + func (f *Float64SliceFlag) TakesValue() bool + type Generic interface + Set func(value string) error + String func() string + type GenericFlag struct + Aliases []string + DefaultText string + EnvVars []string + FilePath string + HasBeenSet bool + Hidden bool + Name string + Required bool + TakesFile bool + Usage string + Value Generic + func (f *GenericFlag) GetUsage() string + func (f *GenericFlag) GetValue() string + func (f *GenericFlag) IsRequired() bool + func (f *GenericFlag) IsSet() bool + func (f *GenericFlag) Names() []string + func (f *GenericFlag) String() string + func (f *GenericFlag) TakesValue() bool + func (f GenericFlag) Apply(set *flag.FlagSet) error + type Int64Flag struct + Aliases []string + DefaultText string + Destination *int64 + EnvVars []string + FilePath string + HasBeenSet bool + Hidden bool + Name string + Required bool + Usage string + Value int64 + func (f *Int64Flag) Apply(set *flag.FlagSet) error + func (f *Int64Flag) GetUsage() string + func (f *Int64Flag) GetValue() string + func (f *Int64Flag) IsRequired() bool + func (f *Int64Flag) IsSet() bool + func (f *Int64Flag) Names() []string + func (f *Int64Flag) String() string + func (f *Int64Flag) TakesValue() bool + type Int64Slice struct + func NewInt64Slice(defaults ...int64) *Int64Slice + func (i *Int64Slice) Get() interface{} + func (i *Int64Slice) Serialize() string + func (i *Int64Slice) Set(value string) error + func (i *Int64Slice) String() string + func (i *Int64Slice) Value() []int64 + type Int64SliceFlag struct + Aliases []string + DefaultText string + EnvVars []string + FilePath string + HasBeenSet bool + Hidden bool + Name string + Required bool + Usage string + Value *Int64Slice + func (f *Int64SliceFlag) Apply(set *flag.FlagSet) error + func (f *Int64SliceFlag) GetValue() string + func (f *Int64SliceFlag) IsRequired() bool + func (f *Int64SliceFlag) IsSet() bool + func (f *Int64SliceFlag) Names() []string + func (f *Int64SliceFlag) String() string + func (f *Int64SliceFlag) TakesValue() bool + func (f Int64SliceFlag) GetUsage() string + type IntFlag struct + Aliases []string + DefaultText string + Destination *int + EnvVars []string + FilePath string + HasBeenSet bool + Hidden bool + Name string + Required bool + Usage string + Value int + func (f *IntFlag) Apply(set *flag.FlagSet) error + func (f *IntFlag) GetUsage() string + func (f *IntFlag) GetValue() string + func (f *IntFlag) IsRequired() bool + func (f *IntFlag) IsSet() bool + func (f *IntFlag) Names() []string + func (f *IntFlag) String() string + func (f *IntFlag) TakesValue() bool + type IntSlice struct + func NewIntSlice(defaults ...int) *IntSlice + func (i *IntSlice) Get() interface{} + func (i *IntSlice) Serialize() string + func (i *IntSlice) Set(value string) error + func (i *IntSlice) SetInt(value int) + func (i *IntSlice) String() string + func (i *IntSlice) Value() []int + type IntSliceFlag struct + Aliases []string + DefaultText string + EnvVars []string + FilePath string + HasBeenSet bool + Hidden bool + Name string + Required bool + Usage string + Value *IntSlice + func (f *IntSliceFlag) Apply(set *flag.FlagSet) error + func (f *IntSliceFlag) GetValue() string + func (f *IntSliceFlag) IsRequired() bool + func (f *IntSliceFlag) IsSet() bool + func (f *IntSliceFlag) Names() []string + func (f *IntSliceFlag) String() string + func (f *IntSliceFlag) TakesValue() bool + func (f IntSliceFlag) GetUsage() string + type MultiError interface + Errors func() []error + type OnUsageErrorFunc func(context *Context, err error, isSubcommand bool) error + type PathFlag struct + Aliases []string + DefaultText string + Destination *string + EnvVars []string + FilePath string + HasBeenSet bool + Hidden bool + Name string + Required bool + TakesFile bool + Usage string + Value string + func (f *PathFlag) Apply(set *flag.FlagSet) error + func (f *PathFlag) GetUsage() string + func (f *PathFlag) GetValue() string + func (f *PathFlag) IsRequired() bool + func (f *PathFlag) IsSet() bool + func (f *PathFlag) Names() []string + func (f *PathFlag) String() string + func (f *PathFlag) TakesValue() bool + type RequiredFlag interface + IsRequired func() bool + type Serializer interface + Serialize func() string + type StringFlag struct + Aliases []string + DefaultText string + Destination *string + EnvVars []string + FilePath string + HasBeenSet bool + Hidden bool + Name string + Required bool + TakesFile bool + Usage string + Value string + func (f *StringFlag) Apply(set *flag.FlagSet) error + func (f *StringFlag) GetUsage() string + func (f *StringFlag) GetValue() string + func (f *StringFlag) IsRequired() bool + func (f *StringFlag) IsSet() bool + func (f *StringFlag) Names() []string + func (f *StringFlag) String() string + func (f *StringFlag) TakesValue() bool + type StringSlice struct + func NewStringSlice(defaults ...string) *StringSlice + func (s *StringSlice) Get() interface{} + func (s *StringSlice) Serialize() string + func (s *StringSlice) Set(value string) error + func (s *StringSlice) String() string + func (s *StringSlice) Value() []string + type StringSliceFlag struct + Aliases []string + DefaultText string + EnvVars []string + FilePath string + HasBeenSet bool + Hidden bool + Name string + Required bool + TakesFile bool + Usage string + Value *StringSlice + func (f *StringSliceFlag) Apply(set *flag.FlagSet) error + func (f *StringSliceFlag) GetUsage() string + func (f *StringSliceFlag) GetValue() string + func (f *StringSliceFlag) IsRequired() bool + func (f *StringSliceFlag) IsSet() bool + func (f *StringSliceFlag) Names() []string + func (f *StringSliceFlag) String() string + func (f *StringSliceFlag) TakesValue() bool + type Timestamp struct + func NewTimestamp(timestamp time.Time) *Timestamp + func (t *Timestamp) Get() interface{} + func (t *Timestamp) Set(value string) error + func (t *Timestamp) SetLayout(layout string) + func (t *Timestamp) SetTimestamp(value time.Time) + func (t *Timestamp) String() string + func (t *Timestamp) Value() *time.Time + type TimestampFlag struct + Aliases []string + DefaultText string + EnvVars []string + FilePath string + HasBeenSet bool + Hidden bool + Layout string + Name string + Required bool + Usage string + Value *Timestamp + func (f *TimestampFlag) Apply(set *flag.FlagSet) error + func (f *TimestampFlag) GetUsage() string + func (f *TimestampFlag) GetValue() string + func (f *TimestampFlag) IsRequired() bool + func (f *TimestampFlag) IsSet() bool + func (f *TimestampFlag) Names() []string + func (f *TimestampFlag) String() string + func (f *TimestampFlag) TakesValue() bool + type Uint64Flag struct + Aliases []string + DefaultText string + Destination *uint64 + EnvVars []string + FilePath string + HasBeenSet bool + Hidden bool + Name string + Required bool + Usage string + Value uint64 + func (f *Uint64Flag) Apply(set *flag.FlagSet) error + func (f *Uint64Flag) GetUsage() string + func (f *Uint64Flag) GetValue() string + func (f *Uint64Flag) IsRequired() bool + func (f *Uint64Flag) IsSet() bool + func (f *Uint64Flag) Names() []string + func (f *Uint64Flag) String() string + func (f *Uint64Flag) TakesValue() bool + type UintFlag struct + Aliases []string + DefaultText string + Destination *uint + EnvVars []string + FilePath string + HasBeenSet bool + Hidden bool + Name string + Required bool + Usage string + Value uint + func (f *UintFlag) Apply(set *flag.FlagSet) error + func (f *UintFlag) GetUsage() string + func (f *UintFlag) GetValue() string + func (f *UintFlag) IsRequired() bool + func (f *UintFlag) IsSet() bool + func (f *UintFlag) Names() []string + func (f *UintFlag) String() string + func (f *UintFlag) TakesValue() bool Other modules containing this package github.com/micro/cli