(args: string[])
| 576 | } |
| 577 | |
| 578 | function parseCodexCleanupInternalThreadsArgs(args: string[]): CodexCleanupInternalThreadsArgs { |
| 579 | const options: CodexCleanupInternalThreadsArgs = { |
| 580 | stateDir: null, |
| 581 | cwd: null, |
| 582 | dryRun: true, |
| 583 | limit: 100_000, |
| 584 | }; |
| 585 | for (let index = 0; index < args.length; index += 1) { |
| 586 | const arg = args[index]; |
| 587 | const next = args[index + 1]; |
| 588 | if (arg === '--state-dir' && next) { |
| 589 | options.stateDir = next; |
| 590 | index += 1; |
| 591 | continue; |
| 592 | } |
| 593 | if (arg === '--cwd' && next) { |
| 594 | options.cwd = next; |
| 595 | index += 1; |
| 596 | continue; |
| 597 | } |
| 598 | if (arg === '--limit' && next) { |
| 599 | const limit = Number.parseInt(next, 10); |
| 600 | if (Number.isFinite(limit) && limit > 0) { |
| 601 | options.limit = limit; |
| 602 | } |
| 603 | index += 1; |
| 604 | continue; |
| 605 | } |
| 606 | if (arg === '--apply') { |
| 607 | options.dryRun = false; |
| 608 | continue; |
| 609 | } |
| 610 | if (arg === '--dry-run') { |
| 611 | options.dryRun = true; |
| 612 | } |
| 613 | } |
| 614 | return options; |
| 615 | } |
| 616 | |
| 617 | function parseCodexNativeApiServeArgs(args: string[]): CodexNativeApiServeArgs { |
| 618 | const options: CodexNativeApiServeArgs = { |
no outgoing calls
no test coverage detected