-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Multi-valued values default value not cleared when set by user (#54)
If you define a multi-valued option or arg, e.g. `StringsOpt` , `IntsArg`, etc. with a default value, this default value is not clered even when the value is set by the user. Example: ```go app := App("app", "") app.ErrorHandling = flag.ContinueOnError opt := app.StringsOpt("o option", []string{"a", "b"}, "") ``` If you run the app with: `app -o=c -o=d`, the final value of the `opt` variable will be `["a", "b", "c", "d"]`. The fix: the multi-valued values were only cleared if their value was set from an env var. This check was removed, so that these values are always cleared before being set.
- Loading branch information
Showing
2 changed files
with
322 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters