Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigFlag ¶
ConfigFlag returns a flag.Value which, when set, parses fs with a config file read from the set file path. The default (zero-value) parser config is used.
func Parse ¶
Parse uses the default Parser to parse an io.Reader for configuration of a flag.FlagSet. The reader must contain newline-delimited name=value pairs for each set flag. Comments begin at any # or ; character and whitespace is trimmed. INI section headers (in the form [Section Name]) and empty lines are ignored.
Types ¶
type Parser ¶
type Parser struct { // AllowUnknown specifies whether Parse should skip unknown flag errors, // or return these errors to the caller. AllowUnknown bool // ParseSections specifies whether to parse INI sections (in the form // [Section Name]). By default, INI section headers are ignored. ParseSections bool }
Parser provides parsing of INI-like config files to modify values in a flag.FlagSet. Parser behavior is configured by its struct fields.
func (*Parser) ConfigFlag ¶
ConfigFlag returns a flag.Value which, when set, parses fs with a config file read from the set file path. Parse options are specified through p.