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

Function parseArgs

scripts/operator-console.js:17–40  ·  view source on GitHub ↗
(argv)

Source from the content-addressed store, hash-verified

15const { selectVerificationProfile } = require('../core/verification/profiles');
16
17function parseArgs(argv) {
18 const args = {
19 projectRoot: process.cwd(),
20 json: false,
21 summary: false,
22 run: false,
23 maxSteps: 3,
24 help: false,
25 };
26
27 for (let index = 0; index < argv.length; index++) {
28 const arg = argv[index];
29 if (arg === '--project-root') args.projectRoot = path.resolve(argv[++index] || '.');
30 else if (arg === '--json') args.json = true;
31 else if (arg === '--summary') args.summary = true;
32 else if (arg === '--run') args.run = true;
33 else if (arg === '--max-steps') {
34 const parsed = Number(argv[++index]);
35 if (!Number.isNaN(parsed) && parsed > 0) args.maxSteps = parsed;
36 } else if (arg === '--help' || arg === '-h') args.help = true;
37 }
38
39 return args;
40}
41
42function usage() {
43 return [

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected