Scott Baker | 1fe7273 | 2019-10-21 10:58:51 -0700 | [diff] [blame] | 1 | package flags |
| 2 | |
| 3 | import ( |
| 4 | "reflect" |
| 5 | ) |
| 6 | |
| 7 | // Arg represents a positional argument on the command line. |
| 8 | type Arg struct { |
| 9 | // The name of the positional argument (used in the help) |
| 10 | Name string |
| 11 | |
| 12 | // A description of the positional argument (used in the help) |
| 13 | Description string |
| 14 | |
| 15 | // The minimal number of required positional arguments |
| 16 | Required int |
| 17 | |
| 18 | // The maximum number of required positional arguments |
| 19 | RequiredMaximum int |
| 20 | |
| 21 | value reflect.Value |
| 22 | tag multiTag |
| 23 | } |
| 24 | |
| 25 | func (a *Arg) isRemaining() bool { |
| 26 | return a.value.Type().Kind() == reflect.Slice |
| 27 | } |