Versions in this module Expand all Collapse all v0 v0.56.3 Sep 3, 2019 v0.55.3 Feb 16, 2019 Changes in this version + var BashCompletionTemplate = ... + var CommandLine = New(filepath.Base(os.Args[0]), "") + var CompactUsageTemplate = ... + var DefaultUsageTemplate = ... + var ManPageTemplate = ... + var T = initI18N() + var TokenEOLMarker = Token + var ZshCompletionTemplate = ... + func Errorf(format string, args ...interface{}) + func ExpandArgsFromFile(filename string) (out []string, err error) + func FatalIfError(err error, format string, args ...interface{}) + func FatalUsage(format string, args ...interface{}) + func FatalUsageContext(context *ParseContext, format string, args ...interface{}) + func Fatalf(format string, args ...interface{}) + func MustParse(command string, err error) string + func Parse() string + func SetLanguage(lang string, others ...string) error + func TError(msg string, args ...interface{}) error + func Usage() + type Action func(app *Application, element *ParseElement, context *ParseContext) error + type Application struct + Help string + Name string + func New(name, help string) *Application + func Struct(v interface{}) *Application + func UsageTemplate(template string) *Application + func Version(version string) *Application + func (a *Application) Action(action Action) *Application + func (a *Application) Author(author string) *Application + func (a *Application) Command(name, help string) *CmdClause + func (a *Application) DefaultEnvars() *Application + func (a *Application) Errorf(format string, args ...interface{}) + func (a *Application) FatalIfError(err error, format string, args ...interface{}) + func (a *Application) FatalUsage(format string, args ...interface{}) + func (a *Application) FatalUsageContext(context *ParseContext, format string, args ...interface{}) + func (a *Application) Fatalf(format string, args ...interface{}) + func (a *Application) Interspersed(interspersed bool) *Application + func (a *Application) Model() *ApplicationModel + func (a *Application) Parse(args []string) (command string, err error) + func (a *Application) ParseContext(args []string) (*ParseContext, error) + func (a *Application) PreAction(action Action) *Application + func (a *Application) Struct(v interface{}) error + func (a *Application) Terminate(terminate func(int)) *Application + func (a *Application) Usage(args []string) + func (a *Application) UsageContext(context *UsageContext) *Application + func (a *Application) UsageForContext(context *ParseContext) error + func (a *Application) UsageForContextWithTemplate(usageContext *UsageContext, parseContext *ParseContext) error + func (a *Application) UsageTemplate(template string) *Application + func (a *Application) Version(version string) *Application + func (a *Application) Writers(out, err io.Writer) *Application + func (c *Application) CmdCompletion(context *ParseContext) []string + func (c *Application) FlagCompletion(flagName string, flagValue string) (choices []string, flagMatch bool, optionMatch bool) + type ApplicationModel struct + Author string + Help string + Name string + Version string + func (a *ApplicationModel) AppSummary() string + func (a *ApplicationModel) FindModelForCommand(cmd *CmdClause) *CmdModel + type ArgGroupModel struct + Args []*ClauseModel + func (a *ArgGroupModel) ArgSummary() string + type Clause struct + func Arg(name, help string) *Clause + func Flag(name, help string) *Clause + func NewClause(name, help string) *Clause + func (c *Clause) Action(action Action) *Clause + func (c *Clause) Bytes() (target *units.Base2Bytes) + func (c *Clause) BytesVar(target *units.Base2Bytes) + func (c *Clause) Counter() (target *int) + func (c *Clause) CounterVar(target *int) + func (c *Clause) Default(values ...string) *Clause + func (c *Clause) Enum(options ...string) (target *string) + func (c *Clause) EnumVar(target *string, options ...string) + func (c *Clause) Enums(options ...string) (target *[]string) + func (c *Clause) EnumsVar(target *[]string, options ...string) + func (c *Clause) Envar(name string) *Clause + func (c *Clause) ExistingDir() (target *string) + func (c *Clause) ExistingDirVar(target *string) + func (c *Clause) ExistingFile() (target *string) + func (c *Clause) ExistingFileOrDir() (target *string) + func (c *Clause) ExistingFileOrDirVar(target *string) + func (c *Clause) ExistingFileVar(target *string) + func (c *Clause) Float() (target *float64) + func (c *Clause) FloatVar(target *float64) + func (c *Clause) GetEnvarValue() string + func (c *Clause) GetSplitEnvarValue() []string + func (c *Clause) HasEnvarValue() bool + func (c *Clause) Hidden() *Clause + func (c *Clause) HintAction(action HintAction) *Clause + func (c *Clause) HintOptions(options ...string) *Clause + func (c *Clause) NoEnvar() *Clause + func (c *Clause) PlaceHolder(placeholder string) *Clause + func (c *Clause) PreAction(action Action) *Clause + func (c *Clause) Required() *Clause + func (c *Clause) SetValue(value Value) + func (c *Clause) Short(name rune) *Clause + func (c *Clause) StringMap() (target *map[string]string) + func (c *Clause) StringMapVar(target *map[string]string) + func (c *Clause) URL() (target **url.URL) + func (c *Clause) URLList() (target *[]*url.URL) + func (c *Clause) URLListVar(target *[]*url.URL) + func (c *Clause) URLVar(target **url.URL) + func (c *Clause) UsageAction(context *UsageContext) *Clause + func (c *Clause) UsageActionTemplate(template string) *Clause + func (f *Clause) Model() *ClauseModel + func (p *Clause) Bool() (target *bool) + func (p *Clause) BoolList() (target *[]bool) + func (p *Clause) BoolListVar(target *[]bool) + func (p *Clause) BoolVar(target *bool) + func (p *Clause) Duration() (target *time.Duration) + func (p *Clause) DurationList() (target *[]time.Duration) + func (p *Clause) DurationListVar(target *[]time.Duration) + func (p *Clause) DurationVar(target *time.Duration) + func (p *Clause) ExistingDirs() (target *[]string) + func (p *Clause) ExistingDirsVar(target *[]string) + func (p *Clause) ExistingFiles() (target *[]string) + func (p *Clause) ExistingFilesOrDirs() (target *[]string) + func (p *Clause) ExistingFilesOrDirsVar(target *[]string) + func (p *Clause) ExistingFilesVar(target *[]string) + func (p *Clause) Float32() (target *float32) + func (p *Clause) Float32List() (target *[]float32) + func (p *Clause) Float32ListVar(target *[]float32) + func (p *Clause) Float32Var(target *float32) + func (p *Clause) Float64() (target *float64) + func (p *Clause) Float64List() (target *[]float64) + func (p *Clause) Float64ListVar(target *[]float64) + func (p *Clause) Float64Var(target *float64) + func (p *Clause) HexBytes() (target *[]byte) + func (p *Clause) HexBytesList() (target *[][]byte) + func (p *Clause) HexBytesListVar(target *[][]byte) + func (p *Clause) HexBytesVar(target *[]byte) + func (p *Clause) Int() (target *int) + func (p *Clause) Int16() (target *int16) + func (p *Clause) Int16List() (target *[]int16) + func (p *Clause) Int16ListVar(target *[]int16) + func (p *Clause) Int16Var(target *int16) + func (p *Clause) Int32() (target *int32) + func (p *Clause) Int32List() (target *[]int32) + func (p *Clause) Int32ListVar(target *[]int32) + func (p *Clause) Int32Var(target *int32) + func (p *Clause) Int64() (target *int64) + func (p *Clause) Int64List() (target *[]int64) + func (p *Clause) Int64ListVar(target *[]int64) + func (p *Clause) Int64Var(target *int64) + func (p *Clause) Int8() (target *int8) + func (p *Clause) Int8List() (target *[]int8) + func (p *Clause) Int8ListVar(target *[]int8) + func (p *Clause) Int8Var(target *int8) + func (p *Clause) IntVar(target *int) + func (p *Clause) Ints() (target *[]int) + func (p *Clause) IntsVar(target *[]int) + func (p *Clause) Regexp() (target **regexp.Regexp) + func (p *Clause) RegexpList() (target *[]*regexp.Regexp) + func (p *Clause) RegexpListVar(target *[]*regexp.Regexp) + func (p *Clause) RegexpVar(target **regexp.Regexp) + func (p *Clause) String() (target *string) + func (p *Clause) StringVar(target *string) + func (p *Clause) Strings() (target *[]string) + func (p *Clause) StringsVar(target *[]string) + func (p *Clause) Uint() (target *uint) + func (p *Clause) Uint16() (target *uint16) + func (p *Clause) Uint16List() (target *[]uint16) + func (p *Clause) Uint16ListVar(target *[]uint16) + func (p *Clause) Uint16Var(target *uint16) + func (p *Clause) Uint32() (target *uint32) + func (p *Clause) Uint32List() (target *[]uint32) + func (p *Clause) Uint32ListVar(target *[]uint32) + func (p *Clause) Uint32Var(target *uint32) + func (p *Clause) Uint64() (target *uint64) + func (p *Clause) Uint64List() (target *[]uint64) + func (p *Clause) Uint64ListVar(target *[]uint64) + func (p *Clause) Uint64Var(target *uint64) + func (p *Clause) Uint8() (target *uint8) + func (p *Clause) Uint8List() (target *[]uint8) + func (p *Clause) Uint8ListVar(target *[]uint8) + func (p *Clause) Uint8Var(target *uint8) + func (p *Clause) UintVar(target *uint) + func (p *Clause) Uints() (target *[]uint) + func (p *Clause) UintsVar(target *[]uint) + type ClauseModel struct + Cumulative bool + Default []string + Envar string + Help string + Hidden bool + Name string + PlaceHolder string + Required bool + Short rune + Value Value + func (c *ClauseModel) FormatPlaceHolder() string + func (c *ClauseModel) IsBoolFlag() bool + func (c *ClauseModel) String() string + type CmdClause struct + func Command(name, help string) *CmdClause + func (c *CmdClause) Action(action Action) *CmdClause + func (c *CmdClause) Alias(name string) *CmdClause + func (c *CmdClause) CmdCompletion(context *ParseContext) []string + func (c *CmdClause) Command(name, help string) *CmdClause + func (c *CmdClause) Default() *CmdClause + func (c *CmdClause) FlagCompletion(flagName string, flagValue string) (choices []string, flagMatch bool, optionMatch bool) + func (c *CmdClause) FullCommand() string + func (c *CmdClause) Hidden() *CmdClause + func (c *CmdClause) Model(parent *CmdModel) *CmdModel + func (c *CmdClause) OptionalSubcommands() *CmdClause + func (c *CmdClause) PreAction(action Action) *CmdClause + func (c *CmdClause) Struct(v interface{}) error + func (c *CmdClause) Validate(validator CmdClauseValidator) *CmdClause + type CmdClauseValidator func(*CmdClause) error + type CmdGroupModel struct + Commands []*CmdModel + func (c *CmdGroupModel) FlattenedCommands() (out []*CmdModel) + type CmdModel struct + Aliases []string + Default bool + Depth int + Help string + Hidden bool + Name string + OptionalSubcommands bool + Parent *CmdModel + func (c *CmdModel) CmdSummary() string + func (c *CmdModel) FullCommand() string + func (c *CmdModel) String() string + type FlagGroupModel struct + Flags []*ClauseModel + func (f *FlagGroupModel) FlagSummary() string + type Getter interface + Get func() interface{} + type HintAction func() []string + type OneOfClause struct + Arg *Clause + Cmd *CmdClause + Flag *Clause + type ParseContext struct + Elements ParseElements + SelectedCommand *CmdClause + func (p *ParseContext) EOL() bool + func (p *ParseContext) HasTrailingArgs() bool + func (p *ParseContext) LastCmd(element *ParseElement) bool + func (p *ParseContext) Next() *Token + func (p *ParseContext) Peek() *Token + func (p *ParseContext) Push(token *Token) *Token + func (p *ParseContext) String() string + type ParseElement struct + OneOf OneOfClause + Value *string + type ParseElements []*ParseElement + func (p ParseElements) ArgMap() map[string]*ParseElement + func (p ParseElements) FlagMap() map[string]*ParseElement + type Settings interface + SetValue func(value Value) + type Token struct + Index int + Type TokenType + Value string + func (t *Token) Equal(o *Token) bool + func (t *Token) IsEOF() bool + func (t *Token) IsFlag() bool + func (t *Token) String() string + type TokenType int + const TokenArg + const TokenEOL + const TokenError + const TokenLong + const TokenShort + func (t TokenType) String() string + type UsageContext struct + Funcs template.FuncMap + Indent int + Template string + Vars map[string]interface{} + Width int + type V map[string]interface + type Value interface + Set func(string) error + String func() string Incompatible versions in this module v2.8.0-3.2.1+incompatible Apr 9, 2020 v2.6.0-3.2.0+incompatible Aug 21, 2019