(raw: string)
| 60 | // Splits the raw args field into tokens, honoring double-quoted groups so an |
| 61 | // argument with spaces stays intact. |
| 62 | function parseStdioArgs(raw: string): string[] { |
| 63 | if (!raw.trim()) return []; |
| 64 | const args: string[] = []; |
| 65 | const regex = /[^\s"]+|"([^"]*)"/g; |
| 66 | let match; |
| 67 | while ((match = regex.exec(raw)) !== null) { |
| 68 | args.push(match[1] ?? match[0]); |
| 69 | } |
| 70 | return args; |
| 71 | } |
| 72 | |
| 73 | // --------------------------------------------------------------------------- |
| 74 | // State machine (remote flow) |
no test coverage detected