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

Function parseArgs

scripts/skill-scaffold.js:17–38  ·  view source on GitHub ↗
(argv)

Source from the content-addressed store, hash-verified

15}
16
17function parseArgs(argv) {
18 const args = {
19 projectRoot: process.cwd(),
20 taskClass: 'utility',
21 riskLevel: 'medium',
22 withBenchmark: false,
23 write: false,
24 };
25 for (let index = 2; index < argv.length; index++) {
26 const arg = argv[index];
27 const value = argv[index + 1];
28 if (arg === '--project-root') { args.projectRoot = path.resolve(value); index++; }
29 else if (arg === '--name') { args.name = slug(value); index++; }
30 else if (arg === '--description') { args.description = value; index++; }
31 else if (arg === '--task-class') { args.taskClass = value; index++; }
32 else if (arg === '--risk-level') { args.riskLevel = value; index++; }
33 else if (arg === '--with-benchmark') args.withBenchmark = true;
34 else if (arg === '--write') args.write = true;
35 else if (arg === '--help' || arg === '-h') args.help = true;
36 }
37 return args;
38}
39
40function usage() {
41 return 'Usage: node scripts/skill-scaffold.js --name name --description "..." [--task-class utility] [--risk-level medium] [--with-benchmark] --write';

Callers 1

mainFunction · 0.70

Calls 1

slugFunction · 0.70

Tested by

no test coverage detected