| 8 | const { writeApprovalCapsule } = require('./next-action'); |
| 9 | |
| 10 | function parseArgs(argv) { |
| 11 | const args = { |
| 12 | projectRoot: process.cwd(), |
| 13 | json: false, |
| 14 | help: false, |
| 15 | }; |
| 16 | |
| 17 | for (let index = 0; index < argv.length; index++) { |
| 18 | const arg = argv[index]; |
| 19 | if (arg === '--project-root') args.projectRoot = path.resolve(argv[++index] || '.'); |
| 20 | else if (arg === '--json') args.json = true; |
| 21 | else if (arg === '--help' || arg === '-h') args.help = true; |
| 22 | } |
| 23 | |
| 24 | return args; |
| 25 | } |
| 26 | |
| 27 | function usage() { |
| 28 | return [ |