(options: OptionDef[])
| 25 | } |
| 26 | |
| 27 | function buildSchema(options: OptionDef[]): FlagSchema { |
| 28 | const booleans = new Set<string>(); |
| 29 | const numbers = new Set<string>(); |
| 30 | const arrays = new Set<string>(); |
| 31 | for (const opt of options) { |
| 32 | const key = flagKey(opt); |
| 33 | if (!key) continue; |
| 34 | if (isBooleanDef(opt)) booleans.add(key); |
| 35 | else if (opt.type === 'number') numbers.add(key); |
| 36 | else if (opt.type === 'array') arrays.add(key); |
| 37 | } |
| 38 | return { booleans, numbers, arrays }; |
| 39 | } |
| 40 | |
| 41 | /** |
| 42 | * Quick scan: collect positional (non-dash) args to determine the command path. |
no test coverage detected