(argv: readonly string[])
| 30 | } |
| 31 | |
| 32 | function parseMode(argv: readonly string[]): SyncMode { |
| 33 | if (argv.includes("--replace") || argv.includes("-r")) { |
| 34 | return "replace"; |
| 35 | } |
| 36 | // Accept both `--mode=replace` and the spaced form `--mode replace`. |
| 37 | const raw = getFlag(argv, ["--mode"]); |
| 38 | if (raw === "replace") { |
| 39 | return "replace"; |
| 40 | } |
| 41 | if (raw !== undefined && raw !== "append") { |
| 42 | throw new Error( |
| 43 | `Unknown --mode value "${raw}" — expected "append" or "replace".`, |
| 44 | ); |
| 45 | } |
| 46 | return "append"; |
| 47 | } |
| 48 | |
| 49 | function parseMaxPerProvider(argv: readonly string[]): number | undefined { |
| 50 | const raw = getFlag(argv, ["--max-per-provider", "--max", "-n"]); |
no test coverage detected
searching dependent graphs…