Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Source ¶
type Source struct {
// contains filtered or unexported fields
}
Source implements a CLI flag settings source. Note all keys are transformed using its KeyTransform method.
func New ¶
New creates a new flags source from OS arguments. WARNING: flags are not typed therefore DO NOT place a short boolean flag before a command word, for example do not use: ./program --enabled command You can however safely use: ./program --enabled=true command Boolean short flags without an equal sign or a value after have their value set to "true". All flag keys read are eventually transformed using the KeyTransform method.
func (*Source) Get ¶
Get returns the value of the flag corresponding to the given key, and a boolean `isSet` to indicate if it is set or not.
func (*Source) KeyTransform ¶
KeyTransform transforms a generic key to a flag key. It notably: - Changes all characters to be lowercase - Replaces all underscores and spaces with dashes.