| 1001 | } |
| 1002 | |
| 1003 | #isOptionNeeded(option: CommandOption, neededOptions: Set<string>): boolean { |
| 1004 | if (neededOptions.has(option.name)) { |
| 1005 | return true; |
| 1006 | } |
| 1007 | |
| 1008 | // `makeOption` derives a single-character alias for these from the name. |
| 1009 | const alias = option.alias ?? (FLAGS_WITH_ALIAS.has(option.name) ? option.name[0] : undefined); |
| 1010 | |
| 1011 | return typeof alias === "string" && neededOptions.has(alias); |
| 1012 | } |
| 1013 | |
| 1014 | // Mirrors when `makeOption` registers a `--no-<name>` negated option. |
| 1015 | #optionSupportsNegation(option: CommandOption): boolean { |