MCPcopy Create free account
hub / github.com/RtlZeroMemory/Rezi / readArg

Function readArg

scripts/hsr/record-runner.mjs:10–16  ·  view source on GitHub ↗
(argv, name, fallback)

Source from the content-addressed store, hash-verified

8const ROUTER_HERO_PREFIX = /\{ text: "[^"\n]*", style: \{ fg: palette\.accent, bold: true \} \},/g;
9
10export function readArg(argv, name, fallback) {
11 const idx = argv.indexOf(name);
12 if (idx === -1) return fallback;
13 const value = argv[idx + 1];
14 if (!value || value.startsWith("--")) return fallback;
15 return value;
16}
17
18export function parsePositiveInt(rawValue, label) {
19 const parsed = Number(rawValue);

Callers 2

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected