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

Function parseArgs

scripts/campaign.js:9–37  ·  view source on GitHub ↗
(argv)

Source from the content-addressed store, hash-verified

7const { getCampaignPaths } = require('../core/campaigns/load-campaign');
8
9function parseArgs(argv) {
10 const args = {
11 command: argv[0] || '',
12 target: argv[1] || '',
13 projectRoot: process.cwd(),
14 archive: false,
15 force: false,
16 pr: '',
17 mergeSha: '',
18 verification: '',
19 note: '',
20 outcome: '',
21 };
22
23 for (let index = 2; index < argv.length; index++) {
24 const arg = argv[index];
25 if (arg === '--project-root') args.projectRoot = path.resolve(argv[++index] || '.');
26 else if (arg === '--archive') args.archive = true;
27 else if (arg === '--force') args.force = true;
28 else if (arg === '--pr') args.pr = argv[++index] || '';
29 else if (arg === '--merge-sha') args.mergeSha = argv[++index] || '';
30 else if (arg === '--verification') args.verification = argv[++index] || '';
31 else if (arg === '--note') args.note = argv[++index] || '';
32 else if (arg === '--outcome') args.outcome = argv[++index] || '';
33 else if (arg === '--help' || arg === '-h') args.help = true;
34 }
35
36 return args;
37}
38
39function usage() {
40 return [

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected