Documentation
¶
Overview ¶
Package params provides implementation of Go API for argument parser
Index ¶
- type Data
- type ErrorHandling
- type Option
- func WithArgumentFilters(filters ...func(string) bool) Option
- func WithConfigFileDescription(desc string) Option
- func WithConfigFilePathDefault(path string) Option
- func WithConfigFilePathKeys(keys ...string) Option
- func WithName(name string) Option
- func WithOverrideDefault(flag bool) Option
- func WithVersionDescription(desc string) Option
- func WithVersionFlagDefault(flag bool) Option
- func WithVersionKeys(keys ...string) Option
- type Parser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrorHandling ¶ added in v1.7.17
type ErrorHandling = flag.ErrorHandling
const ( ContinueOnError ErrorHandling = flag.ContinueOnError PanicOnError ErrorHandling = flag.PanicOnError ExitOnError ErrorHandling = flag.ExitOnError )
type Option ¶
type Option func(*parser)
func WithArgumentFilters ¶ added in v1.7.17
WithArgumentFilters returns Option that sets filters. filters is a slice of functions that takes a string and returns a bool. If the string not matched all filters (means filter returns false), it will be added to the arguments.
func WithConfigFileDescription ¶
WithConfigFileDescription returns Option that sets filePath.description.
func WithConfigFilePathDefault ¶
WithConfigFilePathDefault returns Option that sets filePath.defaultPath.
func WithConfigFilePathKeys ¶
WithConfigFilePathKeys returns Option that sets filePath.keys.
func WithOverrideDefault ¶ added in v1.7.17
WithOverrideDefault returns Option that overrides default flag.CommandLine.
func WithVersionDescription ¶
WithVersionDescription returns Option that sets version.description.
func WithVersionFlagDefault ¶
WithVersionFlagDefault returns Option that sets version.defaultFlag.
func WithVersionKeys ¶
WithVersionKeys returns Option that sets version.keys.