(command: Command, args: string[], values: { [name: string]: unknown })
| 89 | printCommandUsage(command); |
| 90 | throw new InvalidCommandArgumentsError(`Expected ${command.args.length} arguments, got ${args.length}`); |
| 91 | } |
| 92 | } |
| 93 | |
| 94 | Object.entries((command.options as ParseArgsConfig['options']) || {}).forEach(([key, option]) => { |
| 95 | if (option.default !== undefined) { |
| 96 | values[key] = values[key] || option.default; |
| 97 | return; |
| 98 | } |
| 99 | if (values[key] === undefined) { |
| 100 | printCommandUsage(command); |
| 101 | throw new InvalidCommandArgumentsError(`Missing required option: ${key}`); |
| 102 | } |
| 103 | }); |
| 104 | } |
no test coverage detected