Set destination in GenericFlag apply function

The function was missing destination configuration.
This commit is contained in:
Jakub Nowakowski 2022-07-26 16:16:02 +02:00 committed by Dan Buch
parent c5057d195e
commit 01bdec784f
Signed by: meatballhat
GPG Key ID: A12F782281063434

View File

@ -34,6 +34,10 @@ func (f *GenericFlag) Apply(set *flag.FlagSet) error {
}
for _, name := range f.Names() {
if f.Destination != nil {
set.Var(f.Destination, name, f.Usage)
continue
}
set.Var(f.Value, name, f.Usage)
}