( args: string[], index: number, parsed: Parsed, config: ParserConfig<Parsed, ValueKey, BooleanKey>, arg: string, )
| 68 | } |
| 69 | |
| 70 | function applyValueOrPositionalOption< |
| 71 | Parsed extends object, |
| 72 | ValueKey extends keyof Parsed & string, |
| 73 | BooleanKey extends keyof Parsed & string, |
| 74 | >( |
| 75 | args: string[], |
| 76 | index: number, |
| 77 | parsed: Parsed, |
| 78 | config: ParserConfig<Parsed, ValueKey, BooleanKey>, |
| 79 | arg: string, |
| 80 | ) { |
| 81 | const option = config.valueOptions.get(arg); |
| 82 | if (!option) { |
| 83 | return config.parsePositional(arg, index); |
| 84 | } |
| 85 | |
| 86 | parsed[option] = readNextArg(args, index, arg, config.fail) as Parsed[ValueKey]; |
| 87 | return index + 1; |
| 88 | } |
| 89 | |
| 90 | export function parseVersionOptionArgument< |
| 91 | Parsed extends { version?: string }, |
no test coverage detected