Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetStringSliceValue ¶
GetStringSliceValue initializes
func HelpOptions ¶
func HelpOptions() (optionNames []string)
returns implicit help options: "h" "help"
Types ¶
type ArgParser ¶
type ArgParser struct {
// contains filtered or unexported fields
}
func NewArgParser ¶
func NewArgParser(optionsList []OptionData, usage func()) (argParser *ArgParser)
func (*ArgParser) Parse ¶
func (a *ArgParser) Parse()
Parse invokes flag.Parse after providing optionsList and usage to flag package
- -no-flagname flags are inverted before and after
type OptionData ¶
type OptionData struct { P interface{} Name string Value interface{} Usage string Y *YamlValue // pointer to data value from yaml }
OptionData contain options data for the flag package
- OptionData is used for command-line options to be declarative
- instead of flag.BoolVar and similar invocations scattered about the codebase all options are in a single OptionData slice that is iterated so that AddOption is invoked for each element
func (*OptionData) AddOption ¶
func (om *OptionData) AddOption()
AddOption executes flag.BoolVar and such on the options map
func (*OptionData) ApplyYaml ¶
func (om *OptionData) ApplyYaml() (err error)
type StringSliceValue ¶
type StringSliceValue struct {
// contains filtered or unexported fields
}
StringSliceValue manages a string-slice value for flag.Var
func (*StringSliceValue) Set ¶
func (v *StringSliceValue) Set(s string) (err error)
Set updates the string slice
func (StringSliceValue) String ¶
func (v StringSliceValue) String() (s string)
type YamlValue ¶
type YamlValue struct { Name string Pointer interface{} }
func NewYamlValue ¶
func NewYamlValue(instancePointer interface{}, fieldPointer interface{}) (yv *YamlValue)
- instancePointer is a reference to a YamlData value that must be struct
- fieldPointer is a list of references to values read from yaml that matches the fields of YamlData
Click to show internal directories.
Click to hide internal directories.