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

Function parseArgs

scripts/pr-ready.js:10–37  ·  view source on GitHub ↗
(argv)

Source from the content-addressed store, hash-verified

8const { selectVerificationProfile } = require('../core/verification/profiles');
9
10function parseArgs(argv) {
11 const args = {
12 projectRoot: process.cwd(),
13 pr: '',
14 verification: '',
15 verificationSpecified: false,
16 runVerification: false,
17 branch: '',
18 json: false,
19 help: false,
20 };
21
22 for (let index = 0; index < argv.length; index++) {
23 const arg = argv[index];
24 if (arg === '--project-root') args.projectRoot = path.resolve(argv[++index] || '.');
25 else if (arg === '--pr') args.pr = argv[++index] || '';
26 else if (arg === '--verification') {
27 args.verification = argv[++index] || '';
28 args.verificationSpecified = true;
29 }
30 else if (arg === '--run-verification') args.runVerification = true;
31 else if (arg === '--branch') args.branch = argv[++index] || '';
32 else if (arg === '--json') args.json = true;
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