Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExampleFlag ¶
func ExampleFlag()
func ExampleFlagSet ¶
func ExampleFlagSet()
func Parse ¶
ParseWithEnv parses the command-line flags from os.Args[1:]. Must be called after all flags are defined and before flags are accessed by the program.
func ParseFlagSet ¶
ParseFlagSetWithEnv parses flag definitions from the argument list, 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.
Types ¶
type FlagConverterFunc ¶
FlagConverterFunc functions are used to update flag name for envvar lookups.
type Option ¶
type Option option
Option type for configing the parsing.
func FlagConverter ¶
func FlagConverter(f FlagConverterFunc) Option
FlagConverter converts the flag name to an environment variable key.
func UsagePrefixer ¶
func UsagePrefixer() Option
UsagePrefixer prefixes the flag usage with [envvar].
func UsageSuffixer ¶
func UsageSuffixer() Option
UsageSuffixer suffixes the flag usage with [envvar].
func UsageUpdater ¶
func UsageUpdater(f UsageUpdaterFunc) Option
UsageUpdater enables configurable flag usage updates.
Source Files
¶
- example.go
- flag.go