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

Function parseArgs

scripts/usefulness-trial.js:11–32  ·  view source on GitHub ↗
(argv)

Source from the content-addressed store, hash-verified

9const DEFAULT_TASK = 'review README.md for first-time developer friction';
10
11function parseArgs(argv) {
12 const args = {
13 projectRoot: process.env.CLAUDE_PROJECT_DIR || process.cwd(),
14 json: false,
15 write: false,
16 runVerification: false,
17 task: DEFAULT_TASK,
18 help: false,
19 };
20
21 for (let index = 0; index < argv.length; index++) {
22 const arg = argv[index];
23 if (arg === '--project-root') args.projectRoot = path.resolve(argv[++index] || '.');
24 else if (arg === '--json') args.json = true;
25 else if (arg === '--write') args.write = true;
26 else if (arg === '--run-verification') args.runVerification = true;
27 else if (arg === '--task') args.task = argv[++index] || DEFAULT_TASK;
28 else if (arg === '--help' || arg === '-h') args.help = true;
29 }
30
31 return args;
32}
33
34function usage() {
35 return [

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected