Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Flag ¶
type Flag struct { // Alias is an alternative name for a flag, usually shorter :) Alias Name // ConfigPath is the path from the config to the value the flag updates ConfigPath string // DefaultValues will be shoved into Value if the app builder specifies it. // For scalar values, the last DefaultValues wins DefaultValues []string // Envvars holds a list of environment variables to update this flag. Only the first one that exists will be used. EnvVars []string // EmptyConstructor tells flag how to make a value EmptyValueConstructor value.EmptyConstructor // HelpShort is a message for the user on how to use this flag HelpShort HelpShort // Required means the user MUST fill this flag Required bool // IsCommandFlag is set when parsing. Set to true if the flag was attached to a command (as opposed to being inherited from a section) IsCommandFlag bool // SetBy might be set when parsing. Possible values: appdefault, config, passedflag SetBy string // TypeDescription is set when parsing. Describes the type: int, string, ... TypeDescription string // TypeInfo is set when parsing. Describes the "shape" of the type TypeInfo value.TypeContainer // Value might be set when parsing. The interface returned by updating a flag Value value.Value }
type FlagMap ¶
FlagMap holds flags - used by Commands and Sections
func (FlagMap) AddFlags ¶ added in v0.0.13
AddFlags adds another FlagMap to this one and and panics if a flag name already exists
func (*FlagMap) SortedNames ¶ added in v0.0.13
type FlagOpt ¶
type FlagOpt func(*Flag)
FlagOpt customizes a Flag on creation
func Default ¶
Default adds default values to a flag. The flag will be updated with each of the values when Resolve is called. Panics when multiple values are passed and the flags is scalar
Click to show internal directories.
Click to hide internal directories.