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

Function parseArgs

scripts/package-delivery.js:7–27  ·  view source on GitHub ↗
(argv)

Source from the content-addressed store, hash-verified

5const { packageDelivery } = require('../core/campaigns/package-delivery');
6
7function parseArgs(argv) {
8 const args = {
9 projectRoot: process.cwd(),
10 campaign: '',
11 pr: '',
12 note: '',
13 help: false,
14 };
15
16 for (let index = 0; index < argv.length; index++) {
17 const arg = argv[index];
18 if (arg === '--project-root') args.projectRoot = path.resolve(argv[++index] || '.');
19 else if (arg === '--campaign') args.campaign = argv[++index] || '';
20 else if (arg === '--pr') args.pr = argv[++index] || '';
21 else if (arg === '--note') args.note = argv[++index] || '';
22 else if (arg === '--help' || arg === '-h') args.help = true;
23 else if (!arg.startsWith('--') && !args.campaign) args.campaign = arg;
24 }
25
26 return args;
27}
28
29function usage() {
30 return [

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected