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

Function parseArgs

scripts/dashboard.js:23–45  ·  view source on GitHub ↗
(argv)

Source from the content-addressed store, hash-verified

21const ROUTINE_QUOTA_CAP = 15;
22const ROUTINE_QUOTA_WARN_ABOVE = 12;
23
24function parseArgs(argv) {
25 const options = {
26 projectRoot: process.env.CLAUDE_PROJECT_DIR || process.cwd(),
27 json: false,
28 recentLimit: DEFAULT_RECENT_LIMIT,
29 };
30
31 for (let index = 0; index < argv.length; index++) {
32 const arg = argv[index];
33 if (arg === '--json') {
34 options.json = true;
35 } else if (arg === '--project-root') {
36 options.projectRoot = path.resolve(argv[++index]);
37 } else if (arg === '--recent') {
38 const parsed = Number(argv[++index]);
39 if (!Number.isNaN(parsed) && parsed > 0) options.recentLimit = parsed;
40 } else if (arg === '--help' || arg === '-h') {
41 options.help = true;
42 }
43 }
44
45 return options;
46}
47
48function usage() {

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected