Convert env management to a resolver.

This ensures that hooks correctly detect when values are set via
environment variables. Fixes #73.
This commit is contained in:
Alec Thomas
2020-04-16 22:19:21 +10:00
parent a77a484f6a
commit fbe8d48e4b
4 changed files with 35 additions and 11 deletions
+1
View File
@@ -71,6 +71,7 @@ func New(grammar interface{}, options ...Option) (*Kong, error) {
vars: Vars{},
bindings: bindings{},
helpFormatter: DefaultHelpValueFormatter,
resolvers: []Resolver{EnvarResolver()},
}
options = append(options, Bind(k))