(short string, long string, desc string, val bool)
| 16 | } |
| 17 | |
| 18 | func (f *FlagStruct) AddBool(short string, long string, desc string, val bool) error { |
| 19 | |
| 20 | // check if it doesn't exist |
| 21 | if f.Bools[long] == (boolFlag{}) { |
| 22 | f.Bools[long] = boolFlag{short, long, desc, val} |
| 23 | } else { |
| 24 | // not empty, and already exists == no good |
| 25 | return fmt.Errorf("[FlagError] Flag already exists in list of bools %s", long) |
| 26 | } |
| 27 | |
| 28 | return nil |
| 29 | } |
| 30 | |
| 31 | func (f *FlagStruct) AddString(short string, long string, desc string, val string) error { |
| 32 |