Var defines a flag with the specified name and usage string. The type and value of the flag are represented by the first argument, of type Value, which typically holds a user-defined implementation of Value. For instance, the caller could create a flag that turns a comma-separated string into a slic
(value Value, name string, usage string)
| 845 | // of strings by giving the slice the methods of Value; in particular, Set would |
| 846 | // decompose the comma-separated string into the slice. |
| 847 | func (f *FlagSet) Var(value Value, name string, usage string) { |
| 848 | f.VarP(value, name, "", usage) |
| 849 | } |
| 850 | |
| 851 | // VarPF is like VarP, but returns the flag created |
| 852 | func (f *FlagSet) VarPF(value Value, name, shorthand, usage string) *Flag { |