VarPF is like VarP, but returns the flag created
(value Value, name, shorthand, usage string)
| 850 | |
| 851 | // VarPF is like VarP, but returns the flag created |
| 852 | func (f *FlagSet) VarPF(value Value, name, shorthand, usage string) *Flag { |
| 853 | // Remember the default value as a string; it won't change. |
| 854 | flag := &Flag{ |
| 855 | Name: name, |
| 856 | Shorthand: shorthand, |
| 857 | Usage: usage, |
| 858 | Value: value, |
| 859 | DefValue: value.String(), |
| 860 | } |
| 861 | f.AddFlag(flag) |
| 862 | return flag |
| 863 | } |
| 864 | |
| 865 | // VarP is like Var, but accepts a shorthand letter that can be used after a single dash. |
| 866 | func (f *FlagSet) VarP(value Value, name, shorthand, usage string) { |