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

Function parseArgs

scripts/verify-telemetry-integrity.js:9–29  ·  view source on GitHub ↗
(argv)

Source from the content-addressed store, hash-verified

7const { verifyProjectTelemetry } = require('../core/telemetry/integrity');
8
9function parseArgs(argv) {
10 const args = {
11 projectRoot: process.cwd(),
12 json: false,
13 strictLegacy: false,
14 };
15
16 for (let index = 2; index < argv.length; index++) {
17 const arg = argv[index];
18 const value = argv[index + 1];
19 if (arg === '--project-root') { args.projectRoot = path.resolve(value); index++; }
20 else if (arg === '--file') {
21 args.files = [...(args.files || []), path.resolve(args.projectRoot, value)];
22 index++;
23 } else if (arg === '--json') args.json = true;
24 else if (arg === '--strict-legacy') args.strictLegacy = true;
25 else if (arg === '--help' || arg === '-h') args.help = true;
26 }
27
28 return args;
29}
30
31function usage() {
32 return [

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected