AddGoFlagSet will add the given *flag.FlagSet to the pflag.FlagSet
(newSet *goflag.FlagSet)
| 102 | |
| 103 | // AddGoFlagSet will add the given *flag.FlagSet to the pflag.FlagSet |
| 104 | func (f *FlagSet) AddGoFlagSet(newSet *goflag.FlagSet) { |
| 105 | if newSet == nil { |
| 106 | return |
| 107 | } |
| 108 | newSet.VisitAll(func(goflag *goflag.Flag) { |
| 109 | f.AddGoFlag(goflag) |
| 110 | }) |
| 111 | if f.addedGoFlagSets == nil { |
| 112 | f.addedGoFlagSets = make([]*goflag.FlagSet, 0) |
| 113 | } |
| 114 | f.addedGoFlagSets = append(f.addedGoFlagSets, newSet) |
| 115 | } |
| 116 | |
| 117 | // CopyToGoFlagSet will add all current flags to the given Go flag set. |
| 118 | // Deprecation remarks get copied into the usage description. |