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

Function arg

scripts/loop-runner.js:14–20  ·  view source on GitHub ↗
(name, fallback = null)

Source from the content-addressed store, hash-verified

12const { createLoopContract } = require('../core/loops/contract');
13
14function arg(name, fallback = null) {
15 const prefix = `${name}=`;
16 const inline = process.argv.find((value) => value.startsWith(prefix));
17 if (inline) return inline.slice(prefix.length);
18 const idx = process.argv.indexOf(name);
19 return idx >= 0 ? process.argv[idx + 1] : fallback;
20}
21
22function hasFlag(name) {
23 return process.argv.includes(name);

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected