StringP is like String, but accepts a shorthand letter that can be used after a single dash.
(name, shorthand string, value string, usage string)
| 63 | |
| 64 | // StringP is like String, but accepts a shorthand letter that can be used after a single dash. |
| 65 | func (f *FlagSet) StringP(name, shorthand string, value string, usage string) *string { |
| 66 | p := new(string) |
| 67 | f.StringVarP(p, name, shorthand, value, usage) |
| 68 | return p |
| 69 | } |
| 70 | |
| 71 | // String defines a string flag with specified name, default value, and usage string. |
| 72 | // The return value is the address of a string variable that stores the value of the flag. |