MCPcopy Create free account
hub / github.com/cortexkit/magic-context / valueAfter

Function valueAfter

packages/cli/src/index.ts:39–47  ·  view source on GitHub ↗
(args: string[], flag: string)

Source from the content-addressed store, hash-verified

37}
38
39function valueAfter(args: string[], flag: string): string | null {
40 const index = args.indexOf(flag);
41 if (index === -1) return null;
42 // Reject a flag-shaped value so `--rekey-v22-dir-identity --force` doesn't
43 // consume `--force` as the project path (see doctor-pi.ts valueAfter).
44 const next = args[index + 1];
45 if (next === undefined || next.startsWith("--")) return null;
46 return next;
47}
48
49function printUsage(): void {
50 console.log("");

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected