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

Function parseArgs

scripts/evidence-validate.js:13–34  ·  view source on GitHub ↗
(argv)

Source from the content-addressed store, hash-verified

11} = require('../core/evidence/contracts');
12
13function parseArgs(argv) {
14 const args = {
15 projectRoot: process.cwd(),
16 file: null,
17 target: null,
18 json: false,
19 writeRepair: false,
20 allowMissing: false,
21 };
22 for (let index = 2; index < argv.length; index++) {
23 const arg = argv[index];
24 const value = argv[index + 1];
25 if (arg === '--project-root') { args.projectRoot = path.resolve(value); index++; }
26 else if (arg === '--file') { args.file = value; index++; }
27 else if (arg === '--target') { args.target = value; index++; }
28 else if (arg === '--json') args.json = true;
29 else if (arg === '--write-repair') args.writeRepair = true;
30 else if (arg === '--allow-missing') args.allowMissing = true;
31 else if (arg === '--help' || arg === '-h') args.help = true;
32 }
33 return args;
34}
35
36function usage() {
37 return [

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected