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

Function parseArgs

scripts/memory-compile.js:13–26  ·  view source on GitHub ↗
(argv)

Source from the content-addressed store, hash-verified

11} = require('../core/memory/blocks');
12
13function parseArgs(argv) {
14 const args = { mode: argv[2] || 'compile', projectRoot: process.cwd(), json: false };
15 for (let index = 3; index < argv.length; index++) {
16 const arg = argv[index];
17 const value = argv[index + 1];
18 if (arg === '--project-root') { args.projectRoot = path.resolve(value); index++; }
19 else if (arg === '--scope') { args.scope = value; index++; }
20 else if (arg === '--type') { args.type = value; index++; }
21 else if (arg === '--query') { args.query = value; index++; }
22 else if (arg === '--json') args.json = true;
23 else if (arg === '--help' || arg === '-h') args.help = true;
24 }
25 return args;
26}
27
28function usage() {
29 return [

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected