| 11 | } = require('../core/evidence/contracts'); |
| 12 | |
| 13 | function parseArgs(argv) { |
| 14 | const args = { |
| 15 | projectRoot: process.cwd(), |
| 16 | file: null, |
| 17 | target: null, |
| 18 | json: false, |
| 19 | writeRepair: false, |
| 20 | allowMissing: false, |
| 21 | }; |
| 22 | for (let index = 2; index < argv.length; index++) { |
| 23 | const arg = argv[index]; |
| 24 | const value = argv[index + 1]; |
| 25 | if (arg === '--project-root') { args.projectRoot = path.resolve(value); index++; } |
| 26 | else if (arg === '--file') { args.file = value; index++; } |
| 27 | else if (arg === '--target') { args.target = value; index++; } |
| 28 | else if (arg === '--json') args.json = true; |
| 29 | else if (arg === '--write-repair') args.writeRepair = true; |
| 30 | else if (arg === '--allow-missing') args.allowMissing = true; |
| 31 | else if (arg === '--help' || arg === '-h') args.help = true; |
| 32 | } |
| 33 | return args; |
| 34 | } |
| 35 | |
| 36 | function usage() { |
| 37 | return [ |