Parse a KEY=value pair from a flag argument.
(arg: string)
| 42 | |
| 43 | /** Parse a KEY=value pair from a flag argument. */ |
| 44 | function parseKeyValue(arg: string): [string, string] { |
| 45 | const idx = arg.indexOf("=") |
| 46 | if (idx === -1) throw new Error(`Expected KEY=value, got "${arg}"`) |
| 47 | return [arg.slice(0, idx), arg.slice(idx + 1)] |
| 48 | } |
| 49 | |
| 50 | /** Print usage and exit. */ |
| 51 | function printMcpHelp(): void { |