MCPcopy Create free account
hub / github.com/Gan-Xing/CodexBridge / parseCodexCleanupInternalThreadsArgs

Function parseCodexCleanupInternalThreadsArgs

src/cli.ts:578–615  ·  view source on GitHub ↗
(args: string[])

Source from the content-addressed store, hash-verified

576}
577
578function 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
617function parseCodexNativeApiServeArgs(args: string[]): CodexNativeApiServeArgs {
618 const options: CodexNativeApiServeArgs = {

Callers 2

cli.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected