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

Function parseArgs

scripts/route-preview.js:8–32  ·  view source on GitHub ↗
(argv)

Source from the content-addressed store, hash-verified

6const path = require('path');
7const config = require('../core/config');
8const {
9 collectSkillCandidates,
10 normalizeRoutingInput,
11 parseDeterministicCommand,
12 parseRequestEnvelope,
13 resolveDeterministicCommand,
14 routeForSkill,
15 validateRouteOverride,
16} = require('../core/skills/routing');
17
18function parseArgs(argv) {
19 const args = {
20 input: [],
21 json: false,
22 projectRoot: process.cwd(),
23 routeOverride: null,
24 help: false,
25 };
26
27 for (let index = 0; index < argv.length; index++) {
28 const arg = argv[index];
29 if (arg === '--json') args.json = true;
30 else if (arg === '--project-root') args.projectRoot = path.resolve(argv[++index] || '.');
31 else if (arg === '--route') {
32 const value = argv[++index];
33 if (!value) throw new Error('--route requires a route such as /test-gen');
34 args.routeOverride = value;
35 }

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected