-
-
Notifications
You must be signed in to change notification settings - Fork 110
Open
Labels
v2-ideasPossible inclusion in V2Possible inclusion in V2
Description
Reference
I am building a bunch of independent microservices of which everyone uses the same set of Arguments (some with default values).
I then override some of the default values in the services (because some services need different default values than the majority) before parsing the arguments, to get an idea:
var args Args
func main() {
// override defaults
args.SomeBool = false
args.SomeString = "override"
arg.MustParse(&args)
The Args struct is defined globally for everyone:
type Args struct {
SomeString string `arg:"--some-string" default:"test"`
SomeBool bool `arg:"--some-bool" default:"true"`
.
.
.
}
The actual Issue
While overriding bool values I noticed that values that have a default value of "true" in the struct, can't be overridden to "false" but overriding a "false" default value to "true" works.
Seems a bit strange to handle this differently, is this on purpose?
Metadata
Metadata
Assignees
Labels
v2-ideasPossible inclusion in V2Possible inclusion in V2