MCPcopy Create free account
hub / github.com/SethGammon/Citadel / arg

Function arg

scripts/codex-pr-review.js:12–18  ·  view source on GitHub ↗
(name, fallback = null)

Source from the content-addressed store, hash-verified

10const fs = require('fs');
11
12function arg(name, fallback = null) {
13 const prefix = `${name}=`;
14 const inline = process.argv.find((value) => value.startsWith(prefix));
15 if (inline) return inline.slice(prefix.length);
16 const idx = process.argv.indexOf(name);
17 return idx >= 0 ? process.argv[idx + 1] : fallback;
18}
19
20function print(value) {
21 console.log(JSON.stringify(value, null, 2));

Callers 1

codex-pr-review.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected