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

Function parseArgs

scripts/sandbox-provider.js:12–32  ·  view source on GitHub ↗
(argv)

Source from the content-addressed store, hash-verified

10} = require('../core/sandbox/providers');
11
12function parseArgs(argv) {
13 const args = {
14 command: argv[2] || 'matrix',
15 provider: 'worktree',
16 projectRoot: process.cwd(),
17 json: false,
18 write: false,
19 };
20 for (let index = 3; index < argv.length; index++) {
21 const arg = argv[index];
22 const value = argv[index + 1];
23 if (arg === '--provider') { args.provider = value; index++; }
24 else if (arg === '--project-root') { args.projectRoot = path.resolve(value); index++; }
25 else if (arg === '--worktree') { args.worktreePath = path.resolve(value); index++; }
26 else if (arg === '--branch') { args.branch = value; index++; }
27 else if (arg === '--write') args.write = true;
28 else if (arg === '--json') args.json = true;
29 else if (arg === '--help' || arg === '-h') args.help = true;
30 }
31 return args;
32}
33
34function usage() {
35 return [

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected