Versions in this module Expand all Collapse all v1 v1.3.7 May 22, 2015 Changes in this version + var CommandLine = New(filepath.Base(os.Args[0]), "") + var TokenEOLMarker = Token + func ExpandArgsFromFiles(args []string) ([]string, error) + func FatalIfError(err error, prefix string) + func Fatalf(format string, args ...interface{}) + func MustParse(command string, err error) string + func Parse() string + func ParseWithFileExpansion() string + func Usage() + func UsageErrorf(format string, args ...interface{}) + func Version(version string) + type Application struct + Help string + Name string + func New(name, help string) *Application + func (a *Application) Command(name, help string) *CmdClause + func (a *Application) CommandUsage(w io.Writer, command string) + func (a *Application) Errorf(w io.Writer, format string, args ...interface{}) + func (a *Application) FatalIfError(w io.Writer, err error, prefix string) + func (a *Application) Fatalf(w io.Writer, format string, args ...interface{}) + func (a *Application) Parse(args []string) (command string, err error) + func (a *Application) Usage(w io.Writer) + func (a *Application) UsageErrorf(w io.Writer, format string, args ...interface{}) + func (a *Application) Validate(validator ApplicationValidator) *Application + func (a *Application) Version(version string) *Application + func (a Application) Arg(name, help string) *ArgClause + func (f Application) Flag(name, help string) *FlagClause + type ApplicationValidator func(*Application) error + type ArgClause struct + func Arg(name, help string) *ArgClause + func (a *ArgClause) Default(value string) *ArgClause + func (a *ArgClause) Dispatch(dispatch Dispatch) *ArgClause + func (a *ArgClause) Required() *ArgClause + func (p *ArgClause) Bool() (target *bool) + func (p *ArgClause) BoolVar(target *bool) + func (p *ArgClause) Bytes() (target *units.Base2Bytes) + func (p *ArgClause) BytesVar(target *units.Base2Bytes) + func (p *ArgClause) Duration() (target *time.Duration) + func (p *ArgClause) DurationVar(target *time.Duration) + func (p *ArgClause) Enum(options ...string) (target *string) + func (p *ArgClause) EnumVar(target **string, options ...string) + func (p *ArgClause) Enums(options ...string) (target *[]string) + func (p *ArgClause) EnumsVar(target *[]string, options ...string) + func (p *ArgClause) ExistingDir() (target *string) + func (p *ArgClause) ExistingDirVar(target *string) + func (p *ArgClause) ExistingFile() (target *string) + func (p *ArgClause) ExistingFileVar(target *string) + func (p *ArgClause) File() (target **os.File) + func (p *ArgClause) FileVar(target **os.File) + func (p *ArgClause) Float() (target *float64) + func (p *ArgClause) FloatVar(target *float64) + func (p *ArgClause) IP() (target *net.IP) + func (p *ArgClause) IPVar(target *net.IP) + func (p *ArgClause) Int() (target *int) + func (p *ArgClause) Int64() (target *int64) + func (p *ArgClause) Int64Var(target *int64) + func (p *ArgClause) IntVar(target *int) + func (p *ArgClause) OpenFile(flag int, perm os.FileMode) (target **os.File) + func (p *ArgClause) OpenFileVar(target **os.File, flag int, perm os.FileMode) + func (p *ArgClause) SetValue(value Value) + func (p *ArgClause) String() (target *string) + func (p *ArgClause) StringMap() (target *map[string]string) + func (p *ArgClause) StringMapVar(target *map[string]string) + func (p *ArgClause) StringVar(target *string) + func (p *ArgClause) Strings() (target *[]string) + func (p *ArgClause) StringsVar(target *[]string) + func (p *ArgClause) TCP() (target **net.TCPAddr) + func (p *ArgClause) TCPList() (target *[]*net.TCPAddr) + func (p *ArgClause) TCPListVar(target *[]*net.TCPAddr) + func (p *ArgClause) TCPVar(target **net.TCPAddr) + func (p *ArgClause) URL() (target **url.URL) + func (p *ArgClause) URLList() (target *[]*url.URL) + func (p *ArgClause) URLListVar(target *[]*url.URL) + func (p *ArgClause) URLVar(target **url.URL) + func (p *ArgClause) Uint64() (target *uint64) + func (p *ArgClause) Uint64Var(target *uint64) + type CmdClause struct + func Command(name, help string) *CmdClause + func (a CmdClause) Arg(name, help string) *ArgClause + func (c *CmdClause) Command(name, help string) *CmdClause + func (c *CmdClause) Dispatch(dispatch Dispatch) *CmdClause + func (c *CmdClause) FullCommand() string + func (c *CmdClause) Validate(validator CmdClauseValidator) *CmdClause + func (f CmdClause) Flag(name, help string) *FlagClause + type CmdClauseValidator func(*CmdClause) error + type Dispatch func(*ParseContext) error + type FlagClause struct + func Flag(name, help string) *FlagClause + func (f *FlagClause) Bool() (target *bool) + func (f *FlagClause) Default(value string) *FlagClause + func (f *FlagClause) Dispatch(dispatch Dispatch) *FlagClause + func (f *FlagClause) Hidden() *FlagClause + func (f *FlagClause) OverrideDefaultFromEnvar(envar string) *FlagClause + func (f *FlagClause) PlaceHolder(placeholder string) *FlagClause + func (f *FlagClause) Required() *FlagClause + func (f *FlagClause) Short(name byte) *FlagClause + func (p *FlagClause) BoolVar(target *bool) + func (p *FlagClause) Bytes() (target *units.Base2Bytes) + func (p *FlagClause) BytesVar(target *units.Base2Bytes) + func (p *FlagClause) Duration() (target *time.Duration) + func (p *FlagClause) DurationVar(target *time.Duration) + func (p *FlagClause) Enum(options ...string) (target *string) + func (p *FlagClause) EnumVar(target **string, options ...string) + func (p *FlagClause) Enums(options ...string) (target *[]string) + func (p *FlagClause) EnumsVar(target *[]string, options ...string) + func (p *FlagClause) ExistingDir() (target *string) + func (p *FlagClause) ExistingDirVar(target *string) + func (p *FlagClause) ExistingFile() (target *string) + func (p *FlagClause) ExistingFileVar(target *string) + func (p *FlagClause) File() (target **os.File) + func (p *FlagClause) FileVar(target **os.File) + func (p *FlagClause) Float() (target *float64) + func (p *FlagClause) FloatVar(target *float64) + func (p *FlagClause) IP() (target *net.IP) + func (p *FlagClause) IPVar(target *net.IP) + func (p *FlagClause) Int() (target *int) + func (p *FlagClause) Int64() (target *int64) + func (p *FlagClause) Int64Var(target *int64) + func (p *FlagClause) IntVar(target *int) + func (p *FlagClause) OpenFile(flag int, perm os.FileMode) (target **os.File) + func (p *FlagClause) OpenFileVar(target **os.File, flag int, perm os.FileMode) + func (p *FlagClause) SetValue(value Value) + func (p *FlagClause) String() (target *string) + func (p *FlagClause) StringMap() (target *map[string]string) + func (p *FlagClause) StringMapVar(target *map[string]string) + func (p *FlagClause) StringVar(target *string) + func (p *FlagClause) Strings() (target *[]string) + func (p *FlagClause) StringsVar(target *[]string) + func (p *FlagClause) TCP() (target **net.TCPAddr) + func (p *FlagClause) TCPList() (target *[]*net.TCPAddr) + func (p *FlagClause) TCPListVar(target *[]*net.TCPAddr) + func (p *FlagClause) TCPVar(target **net.TCPAddr) + func (p *FlagClause) URL() (target **url.URL) + func (p *FlagClause) URLList() (target *[]*url.URL) + func (p *FlagClause) URLListVar(target *[]*url.URL) + func (p *FlagClause) URLVar(target **url.URL) + func (p *FlagClause) Uint64() (target *uint64) + func (p *FlagClause) Uint64Var(target *uint64) + type Getter interface + Get func() interface{} + type ParseContext struct + SelectedCommand string + Tokens Tokens + func Tokenize(args []string) *ParseContext + func (p *ParseContext) Next() + func (p *ParseContext) Peek() *Token + func (p *ParseContext) Return(token *Token) + func (p *ParseContext) String() string + type Settings interface + SetValue func(value Value) + type Token struct + Type TokenType + Value string + func (t *Token) IsEOF() bool + func (t *Token) IsFlag() bool + func (t *Token) String() string + type TokenType int + const TokenArg + const TokenEOL + const TokenLong + const TokenShort + type Tokens []*Token + func (t Tokens) Next() Tokens + func (t Tokens) Peek() *Token + func (t Tokens) Return(token *Token) Tokens + func (t Tokens) String() string + type Value interface + Set func(string) error + String func() string