Documentation ¶
Index ¶
- Constants
- Variables
- type CmdOptions
- func (co *CmdOptions) GetBool(optionName string) (bool, error)
- func (co *CmdOptions) GetDecimal(optionName string) (int, error)
- func (co *CmdOptions) GetString(optionName string) (string, error)
- func (co *CmdOptions) GetStringArray(optionName string) []string
- func (co *CmdOptions) Parse(format string, options string) error
- func (co *CmdOptions) SetOption(optName string, optType string, defaultValue interface{})
Constants ¶
View Source
const ( OptionTypeBool = "b" OptionTypeDecimal = "d" OptionTypeString = "s" )
Variables ¶
Functions ¶
This section is empty.
Types ¶
type CmdOptions ¶
type CmdOptions struct {
// contains filtered or unexported fields
}
func NewCmdOptions ¶
func NewCmdOptions() CmdOptions
func (*CmdOptions) GetDecimal ¶
func (co *CmdOptions) GetDecimal(optionName string) (int, error)
func (*CmdOptions) GetStringArray ¶
func (co *CmdOptions) GetStringArray(optionName string) []string
func (*CmdOptions) Parse ¶
func (co *CmdOptions) Parse(format string, options string) error
"l:b,p:d,d:s", "-l -p 8080 -d /usrs/wenjing"
func (*CmdOptions) SetOption ¶
func (co *CmdOptions) SetOption(optName string, optType string, defaultValue interface{})
Click to show internal directories.
Click to hide internal directories.