Versions in this module Expand all Collapse all v0 v0.0.1 Jun 25, 2024 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 interface{} + After AfterFunc + ArgsUsage string + Author string + Authors []Author + BashComplete BashCompleteFunc + Before BeforeFunc + CommandNotFound CommandNotFoundFunc + Commands []Command + Compiled time.Time + Copyright string + CustomAppHelpTemplate string + Description string + Email 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) Categories() CommandCategories + 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) 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 []string + func (a Args) First() string + func (a Args) Get(n int) string + func (a Args) Present() bool + func (a Args) Swap(from, to int) error + func (a Args) Tail() []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 + Destination *bool + EnvVar string + FilePath string + Hidden bool + Name string + Required bool + Usage string + func (f BoolFlag) Apply(set *flag.FlagSet) + func (f BoolFlag) ApplyWithError(set *flag.FlagSet) error + func (f BoolFlag) GetName() string + func (f BoolFlag) GetUsage() string + func (f BoolFlag) GetValue() string + func (f BoolFlag) IsRequired() bool + func (f BoolFlag) String() string + func (f BoolFlag) TakesValue() bool + type BoolTFlag struct + Destination *bool + EnvVar string + FilePath string + Hidden bool + Name string + Required bool + Usage string + func (f BoolTFlag) Apply(set *flag.FlagSet) + func (f BoolTFlag) ApplyWithError(set *flag.FlagSet) error + func (f BoolTFlag) GetName() string + func (f BoolTFlag) GetUsage() string + func (f BoolTFlag) GetValue() string + func (f BoolTFlag) IsRequired() bool + func (f BoolTFlag) String() string + func (f BoolTFlag) TakesValue() bool + type Command struct + Action interface{} + 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 + ShortName string + SkipArgReorder bool + SkipFlagParsing bool + Subcommands Commands + 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 []*CommandCategory + func (c CommandCategories) AddCommand(category string, command Command) CommandCategories + func (c CommandCategories) Len() int + func (c CommandCategories) Less(i, j int) bool + func (c CommandCategories) Swap(i, j int) + type CommandCategory struct + Commands Commands + Name string + func (c *CommandCategory) VisibleCommands() []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) BoolT(name string) bool + func (c *Context) Duration(name string) time.Duration + func (c *Context) FlagNames() (names []string) + func (c *Context) Float64(name string) float64 + func (c *Context) Generic(name string) interface{} + func (c *Context) GlobalBool(name string) bool + func (c *Context) GlobalBoolT(name string) bool + func (c *Context) GlobalDuration(name string) time.Duration + func (c *Context) GlobalFlagNames() (names []string) + func (c *Context) GlobalFloat64(name string) float64 + func (c *Context) GlobalGeneric(name string) interface{} + func (c *Context) GlobalInt(name string) int + func (c *Context) GlobalInt64(name string) int64 + func (c *Context) GlobalInt64Slice(name string) []int64 + func (c *Context) GlobalIntSlice(name string) []int + func (c *Context) GlobalIsSet(name string) bool + func (c *Context) GlobalSet(name, value string) error + func (c *Context) GlobalString(name string) string + func (c *Context) GlobalStringSlice(name string) []string + func (c *Context) GlobalUint(name string) uint + func (c *Context) GlobalUint64(name string) uint64 + 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) NArg() int + func (c *Context) NumFlags() int + func (c *Context) Parent() *Context + 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) Uint(name string) uint + func (c *Context) Uint64(name string) uint64 + type DocGenerationFlag interface + GetUsage func() string + GetValue func() string + TakesValue func() bool + type DurationFlag struct + Destination *time.Duration + EnvVar string + FilePath string + Hidden bool + Name string + Required bool + Usage string + Value time.Duration + func (f DurationFlag) Apply(set *flag.FlagSet) + func (f DurationFlag) ApplyWithError(set *flag.FlagSet) error + func (f DurationFlag) GetName() string + func (f DurationFlag) GetUsage() string + func (f DurationFlag) GetValue() string + func (f DurationFlag) IsRequired() bool + 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 + type ExitErrHandlerFunc func(context *Context, err error) + type ExitError struct + func NewExitError(message interface{}, exitCode int) *ExitError + func (ee *ExitError) Error() string + func (ee *ExitError) ExitCode() int + type Flag interface + Apply func(*flag.FlagSet) + GetName func() string + var BashCompletionFlag Flag = BoolFlag{ ... } + var HelpFlag Flag = BoolFlag{ ... } + var VersionFlag Flag = BoolFlag{ ... } + type FlagEnvHintFunc func(envVar, str string) string + var FlagEnvHinter FlagEnvHintFunc = withEnvHint + type FlagFileHintFunc func(filePath, str string) string + var FlagFileHinter FlagFileHintFunc = withFileHint + type FlagNamePrefixFunc func(fullName, 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 + Destination *float64 + EnvVar string + FilePath string + Hidden bool + Name string + Required bool + Usage string + Value float64 + func (f Float64Flag) Apply(set *flag.FlagSet) + func (f Float64Flag) ApplyWithError(set *flag.FlagSet) error + func (f Float64Flag) GetName() string + func (f Float64Flag) GetUsage() string + func (f Float64Flag) GetValue() string + func (f Float64Flag) IsRequired() bool + func (f Float64Flag) String() string + func (f Float64Flag) TakesValue() bool + type Generic interface + Set func(value string) error + String func() string + type GenericFlag struct + EnvVar string + FilePath string + Hidden bool + Name string + Required bool + TakesFile bool + Usage string + Value Generic + func (f GenericFlag) Apply(set *flag.FlagSet) + func (f GenericFlag) ApplyWithError(set *flag.FlagSet) error + func (f GenericFlag) GetName() string + func (f GenericFlag) GetUsage() string + func (f GenericFlag) GetValue() string + func (f GenericFlag) IsRequired() bool + func (f GenericFlag) String() string + func (f GenericFlag) TakesValue() bool + type Int64Flag struct + Destination *int64 + EnvVar string + FilePath string + Hidden bool + Name string + Required bool + Usage string + Value int64 + func (f Int64Flag) Apply(set *flag.FlagSet) + func (f Int64Flag) ApplyWithError(set *flag.FlagSet) error + func (f Int64Flag) GetName() string + func (f Int64Flag) GetUsage() string + func (f Int64Flag) GetValue() string + func (f Int64Flag) IsRequired() bool + func (f Int64Flag) String() string + func (f Int64Flag) TakesValue() bool + type Int64Slice []int64 + func (f *Int64Slice) Get() interface{} + func (f *Int64Slice) Set(value string) error + func (f *Int64Slice) String() string + func (f *Int64Slice) Value() []int64 + type Int64SliceFlag struct + EnvVar string + FilePath string + Hidden bool + Name string + Required bool + Usage string + Value *Int64Slice + func (f Int64SliceFlag) Apply(set *flag.FlagSet) + func (f Int64SliceFlag) ApplyWithError(set *flag.FlagSet) error + func (f Int64SliceFlag) GetName() string + func (f Int64SliceFlag) GetUsage() string + func (f Int64SliceFlag) GetValue() string + func (f Int64SliceFlag) IsRequired() bool + func (f Int64SliceFlag) String() string + func (f Int64SliceFlag) TakesValue() bool + type IntFlag struct + Destination *int + EnvVar string + FilePath string + Hidden bool + Name string + Required bool + Usage string + Value int + func (f IntFlag) Apply(set *flag.FlagSet) + func (f IntFlag) ApplyWithError(set *flag.FlagSet) error + func (f IntFlag) GetName() string + func (f IntFlag) GetUsage() string + func (f IntFlag) GetValue() string + func (f IntFlag) IsRequired() bool + func (f IntFlag) String() string + func (f IntFlag) TakesValue() bool + type IntSlice []int + func (f *IntSlice) Get() interface{} + func (f *IntSlice) Set(value string) error + func (f *IntSlice) String() string + func (f *IntSlice) Value() []int + type IntSliceFlag struct + EnvVar string + FilePath string + Hidden bool + Name string + Required bool + Usage string + Value *IntSlice + func (f IntSliceFlag) Apply(set *flag.FlagSet) + func (f IntSliceFlag) ApplyWithError(set *flag.FlagSet) error + func (f IntSliceFlag) GetName() string + func (f IntSliceFlag) GetUsage() string + func (f IntSliceFlag) GetValue() string + func (f IntSliceFlag) IsRequired() bool + func (f IntSliceFlag) String() string + func (f IntSliceFlag) TakesValue() bool + type MultiError struct + Errors []error + func NewMultiError(err ...error) MultiError + func (m MultiError) Error() string + type OnUsageErrorFunc func(context *Context, err error, isSubcommand bool) error + type RequiredFlag interface + IsRequired func() bool + type StringFlag struct + Destination *string + EnvVar string + FilePath string + Hidden bool + Name string + Required bool + TakesFile bool + Usage string + Value string + func (f StringFlag) Apply(set *flag.FlagSet) + func (f StringFlag) ApplyWithError(set *flag.FlagSet) error + func (f StringFlag) GetName() string + func (f StringFlag) GetUsage() string + func (f StringFlag) GetValue() string + func (f StringFlag) IsRequired() bool + func (f StringFlag) String() string + func (f StringFlag) TakesValue() bool + type StringSlice []string + func (f *StringSlice) Get() interface{} + func (f *StringSlice) Set(value string) error + func (f *StringSlice) String() string + func (f *StringSlice) Value() []string + type StringSliceFlag struct + EnvVar string + FilePath string + Hidden bool + Name string + Required bool + TakesFile bool + Usage string + Value *StringSlice + func (f StringSliceFlag) Apply(set *flag.FlagSet) + func (f StringSliceFlag) ApplyWithError(set *flag.FlagSet) error + func (f StringSliceFlag) GetName() string + func (f StringSliceFlag) GetUsage() string + func (f StringSliceFlag) GetValue() string + func (f StringSliceFlag) IsRequired() bool + func (f StringSliceFlag) String() string + func (f StringSliceFlag) TakesValue() bool + type Uint64Flag struct + Destination *uint64 + EnvVar string + FilePath string + Hidden bool + Name string + Required bool + Usage string + Value uint64 + func (f Uint64Flag) Apply(set *flag.FlagSet) + func (f Uint64Flag) ApplyWithError(set *flag.FlagSet) error + func (f Uint64Flag) GetName() string + func (f Uint64Flag) GetUsage() string + func (f Uint64Flag) GetValue() string + func (f Uint64Flag) IsRequired() bool + func (f Uint64Flag) String() string + func (f Uint64Flag) TakesValue() bool + type UintFlag struct + Destination *uint + EnvVar string + FilePath string + Hidden bool + Name string + Required bool + Usage string + Value uint + func (f UintFlag) Apply(set *flag.FlagSet) + func (f UintFlag) ApplyWithError(set *flag.FlagSet) error + func (f UintFlag) GetName() string + func (f UintFlag) GetUsage() string + func (f UintFlag) GetValue() string + func (f UintFlag) IsRequired() bool + func (f UintFlag) String() string + func (f UintFlag) TakesValue() bool