Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrFlagBinding = errors.New("failed to bind flag")
Functions ¶
Types ¶
type FlagBinding ¶
type FlagBinding struct { Usage string Name string Shorthand rune // One character for a shorthand. Target any Default any Parser FlagBindingParser }
FlagBinding represents the info for simplify the setup of the popular command line management packages such as spf13/pflag and spf13/viper.
- Set up the name (posix flag aka pflag), shorthand (arg), and usage (description) of a flag.
- Define the default value of a flag.
- Once a flag is set by the user, where to bind the value of a flag to a target (variable or a field in a struct object).
type FlagBindingParser ¶
Click to show internal directories.
Click to hide internal directories.