Documentation
¶
Index ¶
- type Option
- type OptionObject
- func (o *OptionObject) GetCount() int
- func (o *OptionObject) GetLong() string
- func (o *OptionObject) GetShort() string
- func (o *OptionObject) GetValue() (string, error)
- func (o *OptionObject) GetValues() []string
- func (o *OptionObject) IsSet() bool
- func (o *OptionObject) SetDefault(value string) Option
- func (o *OptionObject) SetDescription(description string) Option
- func (o *OptionObject) SetFlag() Option
- func (o *OptionObject) SetLong(long string) Option
- func (o *OptionObject) SetMultiple() Option
- func (o *OptionObject) SetRequired() Option
- func (o *OptionObject) SetShort(short string) Option
- type Parser
- type ParserObject
- func (po *ParserObject) AddOption(o *OptionObject) Parser
- func (po *ParserObject) GetAll() []*OptionObject
- func (po *ParserObject) GetHelpOption() *OptionObject
- func (po *ParserObject) GetUsage() string
- func (po *ParserObject) GetValuesFromLong(long string) []string
- func (po *ParserObject) GetValuesFromShort(short string) []string
- func (po *ParserObject) Parse() ([]string, error)
- func (po *ParserObject) ParseArgs(args []string) ([]string, error)
- func (po *ParserObject) PrintUsage() (int, error)
- func (po *ParserObject) SetEpilog(epilog string) Parser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option interface {
GetShort() string
SetShort(string) Option
GetLong() string
SetLong(string) Option
SetRequired() Option
SetDescription(string) Option
SetMultiple() Option
SetDefault(string) Option
GetValues() []string
GetValue() (string, error)
IsSet() bool
SetFlag() Option
GetCount() int
// contains filtered or unexported methods
}
type OptionObject ¶
type OptionObject struct {
// contains filtered or unexported fields
}
func (*OptionObject) GetCount ¶
func (o *OptionObject) GetCount() int
func (*OptionObject) GetLong ¶
func (o *OptionObject) GetLong() string
func (*OptionObject) GetShort ¶
func (o *OptionObject) GetShort() string
func (*OptionObject) GetValue ¶
func (o *OptionObject) GetValue() (string, error)
func (*OptionObject) GetValues ¶
func (o *OptionObject) GetValues() []string
func (*OptionObject) IsSet ¶
func (o *OptionObject) IsSet() bool
func (*OptionObject) SetDefault ¶
func (o *OptionObject) SetDefault(value string) Option
func (*OptionObject) SetDescription ¶
func (o *OptionObject) SetDescription(description string) Option
func (*OptionObject) SetFlag ¶
func (o *OptionObject) SetFlag() Option
func (*OptionObject) SetLong ¶
func (o *OptionObject) SetLong(long string) Option
func (*OptionObject) SetMultiple ¶
func (o *OptionObject) SetMultiple() Option
func (*OptionObject) SetRequired ¶
func (o *OptionObject) SetRequired() Option
func (*OptionObject) SetShort ¶
func (o *OptionObject) SetShort(short string) Option
type Parser ¶
type Parser interface {
SetEpilog(string) Parser
AddOption(o *OptionObject) Parser
GetHelpOption() *OptionObject
GetAll() []*OptionObject
GetValuesFromShort(string) []string
GetValuesFromLong(string) []string
Parse() ([]string, error)
ParseArgs([]string) ([]string, error)
GetUsage() string
PrintUsage() (int, error)
}
type ParserObject ¶
type ParserObject struct {
// contains filtered or unexported fields
}
func NewParser ¶
func NewParser(program string, description string) *ParserObject
func (*ParserObject) AddOption ¶
func (po *ParserObject) AddOption(o *OptionObject) Parser
func (*ParserObject) GetAll ¶
func (po *ParserObject) GetAll() []*OptionObject
func (*ParserObject) GetHelpOption ¶
func (po *ParserObject) GetHelpOption() *OptionObject
func (*ParserObject) GetUsage ¶
func (po *ParserObject) GetUsage() string
func (*ParserObject) GetValuesFromLong ¶
func (po *ParserObject) GetValuesFromLong(long string) []string
func (*ParserObject) GetValuesFromShort ¶
func (po *ParserObject) GetValuesFromShort(short string) []string
func (*ParserObject) Parse ¶
func (po *ParserObject) Parse() ([]string, error)
func (*ParserObject) PrintUsage ¶
func (po *ParserObject) PrintUsage() (int, error)
func (*ParserObject) SetEpilog ¶
func (po *ParserObject) SetEpilog(epilog string) Parser
Click to show internal directories.
Click to hide internal directories.