(name: string)
| 2543 | } |
| 2544 | |
| 2545 | function readArgValue(name: string): string | undefined { |
| 2546 | const argv = process.argv.slice(2); |
| 2547 | const index = argv.indexOf(name); |
| 2548 | if (index === -1) { |
| 2549 | return undefined; |
| 2550 | } |
| 2551 | const value = argv[index + 1]?.trim(); |
| 2552 | if (!value || value.startsWith("--")) { |
| 2553 | throw new Error(`${name} requires a path.`); |
| 2554 | } |
| 2555 | return value; |
| 2556 | } |
| 2557 | |
| 2558 | main().catch((error) => { |
| 2559 | const output = buildSmokeCliErrorOutput(error); |