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

Function parseArgs

scripts/run-bench-ci.mjs:34–55  ·  view source on GitHub ↗
(argv)

Source from the content-addressed store, hash-verified

32}
33
34function parseArgs(argv) {
35 let outputDir = null;
36
37 for (let i = 0; i < argv.length; i++) {
38 const arg = argv[i];
39
40 if (arg === "--output-dir") {
41 outputDir = argv[++i] ?? null;
42 if (!outputDir) fail("missing value for --output-dir");
43 continue;
44 }
45
46 if (arg === "--help" || arg === "-h") {
47 printHelp();
48 process.exit(0);
49 }
50
51 fail(`unknown argument: ${arg}`);
52 }
53
54 return { outputDir };
55}
56
57function toAbsPath(pathValue) {
58 return isAbsolute(pathValue) ? pathValue : resolve(ROOT, pathValue);

Callers 1

mainFunction · 0.70

Calls 2

failFunction · 0.70
printHelpFunction · 0.70

Tested by

no test coverage detected