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

Function arg

scripts/codex-automation.js:10–16  ·  view source on GitHub ↗
(name, fallback = null)

Source from the content-addressed store, hash-verified

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

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected