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

Function arg

scripts/loops.js:16–22  ·  view source on GitHub ↗
(name, fallback = null)

Source from the content-addressed store, hash-verified

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

Callers 3

projectRootFunction · 0.70
contractFromArgsFunction · 0.70
mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected