| 8 | const { selectVerificationProfile } = require('../core/verification/profiles'); |
| 9 | |
| 10 | function 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 | |
| 39 | function usage() { |
| 40 | return [ |