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

Function parseArgs

scripts/next-action.js:9–30  ·  view source on GitHub ↗
(argv)

Source from the content-addressed store, hash-verified

7const { collectDashboard } = require('./dashboard');
8
9function parseArgs(argv) {
10 const args = {
11 projectRoot: process.env.CLAUDE_PROJECT_DIR || process.cwd(),
12 json: false,
13 run: false,
14 maxSteps: 3,
15 help: false,
16 };
17
18 for (let index = 0; index < argv.length; index++) {
19 const arg = argv[index];
20 if (arg === '--project-root') args.projectRoot = path.resolve(argv[++index] || '.');
21 else if (arg === '--json') args.json = true;
22 else if (arg === '--run') args.run = true;
23 else if (arg === '--max-steps') {
24 const parsed = Number(argv[++index]);
25 if (!Number.isNaN(parsed) && parsed > 0) args.maxSteps = parsed;
26 } else if (arg === '--help' || arg === '-h') args.help = true;
27 }
28
29 return args;
30}
31
32function usage() {
33 return [

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected