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

Function parseArgs

scripts/watch.js:53–74  ·  view source on GitHub ↗
(argv)

Source from the content-addressed store, hash-verified

51// -- CLI argument parser ------------------------------------------------------
52
53function parseArgs(argv) {
54 const opts = {
55 mode: null,
56 json: false,
57 intake: false,
58 };
59
60 for (const arg of argv) {
61 if (arg === '--scan') opts.mode = 'scan';
62 if (arg === '--status') opts.mode = 'status';
63 if (arg === '--reset') opts.mode = 'reset';
64 if (arg === '--json') opts.json = true;
65 if (arg === '--intake') opts.intake = true;
66 }
67
68 if (!opts.mode) {
69 console.error('Usage: node scripts/watch.js [--scan|--status|--reset] [--json] [--intake]');
70 process.exit(1);
71 }
72
73 return opts;
74}
75
76// -- Marker identity ----------------------------------------------------------
77

Callers 7

mainFunction · 0.70
mainFunction · 0.70
mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected