Documentation
¶
Index ¶
- type Flag
- func (f *Flag) BoolVarF(ptr *bool, name string, shortName string, value bool, usage string)
- func (f *Flag) Format() []string
- func (f *Flag) IntVarF(ptr *int, name string, shortName string, value int, usage string)
- func (f *Flag) ParseFlags()
- func (f *Flag) StringVarF(ptr *string, name string, shortName string, value string, usage string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Flag ¶
type Flag struct {
// contains filtered or unexported fields
}
Flag is used for cli parameters.
func (*Flag) BoolVarF ¶
BoolVarF defines 2 bool flags with specified name and shortName, default value, and usage string. The argument ptr points to a bool variable in which to store the value of the flag.
func (*Flag) Format ¶
Format function formats Flag f for cli display.
func (*Flag) IntVarF ¶
IntVarF defines 2 int flags for specified name and shortName with default value, and usage string. The argument ptr points to an int variable in which to store the value of the flag.
func (*Flag) ParseFlags ¶
func (f *Flag) ParseFlags()
ParseFlags parses flag definitions from the command line, which should not include the command name. Must be called after all flags in the FlagSet are defined and before flags are accessed by the program. The return value will be ErrHelp if -help or -h were set but not defined.
func (*Flag) StringVarF ¶
StringVarF defines 2 string flags for specified name and shortName, default value, and usage string. The argument ptr points to a string variable in which to store the value of the flag.