Versions in this module Expand all Collapse all v1 v1.3.0 Jul 20, 2017 v1.2.0 Feb 12, 2017 Changes in this version type Option + func (option *Option) IsSetDefault() bool v1.1.0 Nov 4, 2016 Changes in this version + const Default + const HelpFlag + const IgnoreUnknown + const IniCommentDefaults + const IniDefault + const IniIncludeComments + const IniIncludeDefaults + const IniNone + const None + const PassAfterNonOption + const PassDoubleDash + const PrintErrors + var ErrNotPointerToStruct = errors.New("provided data is not a pointer to struct") + func IniParse(filename string, data interface{}) error + func Parse(data interface{}) ([]string, error) + func ParseArgs(data interface{}, args []string) ([]string, error) + type Arg struct + Description string + Name string + Required int + RequiredMaximum int + type Command struct + Active *Command + Aliases []string + ArgsRequired bool + Name string + SubcommandsOptional bool + func (c *Command) AddCommand(command string, shortDescription string, longDescription string, ...) (*Command, error) + func (c *Command) AddGroup(shortDescription string, longDescription string, data interface{}) (*Group, error) + func (c *Command) Args() []*Arg + func (c *Command) Commands() []*Command + func (c *Command) Find(name string) *Command + func (c *Command) FindOptionByLongName(longName string) (option *Option) + func (c *Command) FindOptionByShortName(shortName rune) (option *Option) + type Commander interface + Execute func(args []string) error + type Completer interface + Complete func(match string) []Completion + type Completion struct + Description string + Item string + type Error struct + Message string + Type ErrorType + func (e *Error) Error() string + type ErrorType uint + const ErrCommandRequired + const ErrDuplicatedFlag + const ErrExpectedArgument + const ErrHelp + const ErrInvalidChoice + const ErrInvalidTag + const ErrMarshal + const ErrNoArgumentForBool + const ErrRequired + const ErrShortNameTooLong + const ErrTag + const ErrUnknown + const ErrUnknownCommand + const ErrUnknownFlag + const ErrUnknownGroup + func (e ErrorType) String() string + type Filename string + func (f *Filename) Complete(match string) []Completion + type Group struct + Hidden bool + LongDescription string + Namespace string + ShortDescription string + func (g *Group) AddGroup(shortDescription string, longDescription string, data interface{}) (*Group, error) + func (g *Group) Find(shortDescription string) *Group + func (g *Group) FindOptionByLongName(longName string) *Option + func (g *Group) FindOptionByShortName(shortName rune) *Option + func (g *Group) Groups() []*Group + func (g *Group) Options() []*Option + type IniError struct + File string + LineNumber uint + Message string + func (x *IniError) Error() string + type IniOptions uint + type IniParser struct + ParseAsDefaults bool + func NewIniParser(p *Parser) *IniParser + func (i *IniParser) Parse(reader io.Reader) error + func (i *IniParser) ParseFile(filename string) error + func (i *IniParser) Write(writer io.Writer, options IniOptions) + func (i *IniParser) WriteFile(filename string, options IniOptions) error + type Marshaler interface + MarshalFlag func() (string, error) + type Option struct + Choices []string + Default []string + DefaultMask string + Description string + EnvDefaultDelim string + EnvDefaultKey string + Hidden bool + LongName string + OptionalArgument bool + OptionalValue []string + Required bool + ShortName rune + ValueName string + func (option *Option) Field() reflect.StructField + func (option *Option) IsSet() bool + func (option *Option) LongNameWithNamespace() string + func (option *Option) String() string + func (option *Option) Value() interface{} + type Options uint + type Parser struct + CommandHandler func(command Commander, args []string) error + CompletionHandler func(items []Completion) + NamespaceDelimiter string + Options Options + UnknownOptionHandler func(option string, arg SplitArgument, args []string) ([]string, error) + Usage string + func NewNamedParser(appname string, options Options) *Parser + func NewParser(data interface{}, options Options) *Parser + func (p *Parser) Parse() ([]string, error) + func (p *Parser) ParseArgs(args []string) ([]string, error) + func (p *Parser) WriteHelp(writer io.Writer) + func (p *Parser) WriteManPage(wr io.Writer) + type SplitArgument interface + Value func() (string, bool) + type Unmarshaler interface + UnmarshalFlag func(value string) error + type Usage interface + Usage func() string