2023-03-28 19:12:30 +00:00
|
|
|
// Copyright (c) HashiCorp, Inc.
|
|
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
|
|
|
2017-10-11 12:51:19 +00:00
|
|
|
package flags
|
|
|
|
|
|
|
|
import "flag"
|
|
|
|
|
|
|
|
func Merge(dst, src *flag.FlagSet) {
|
|
|
|
if dst == nil {
|
|
|
|
panic("dst cannot be nil")
|
|
|
|
}
|
|
|
|
if src == nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
src.VisitAll(func(f *flag.Flag) {
|
2017-10-17 22:00:01 +00:00
|
|
|
dst.Var(f.Value, f.Name, f.Usage)
|
2017-10-11 12:51:19 +00:00
|
|
|
})
|
|
|
|
}
|