AddFlagSet adds one FlagSet to another. If a flag is already present in f the flag from newSet will be ignored.
(newSet *FlagSet)
| 909 | // AddFlagSet adds one FlagSet to another. If a flag is already present in f |
| 910 | // the flag from newSet will be ignored. |
| 911 | func (f *FlagSet) AddFlagSet(newSet *FlagSet) { |
| 912 | if newSet == nil { |
| 913 | return |
| 914 | } |
| 915 | newSet.VisitAll(func(flag *Flag) { |
| 916 | if f.Lookup(flag.Name) == nil { |
| 917 | f.AddFlag(flag) |
| 918 | } |
| 919 | }) |
| 920 | } |
| 921 | |
| 922 | // Var defines a flag with the specified name and usage string. The type and |
| 923 | // value of the flag are represented by the first argument, of type Value, which |