| 11 | } = require('../core/memory/blocks'); |
| 12 | |
| 13 | function parseArgs(argv) { |
| 14 | const args = { mode: argv[2] || 'compile', projectRoot: process.cwd(), json: false }; |
| 15 | for (let index = 3; index < argv.length; index++) { |
| 16 | const arg = argv[index]; |
| 17 | const value = argv[index + 1]; |
| 18 | if (arg === '--project-root') { args.projectRoot = path.resolve(value); index++; } |
| 19 | else if (arg === '--scope') { args.scope = value; index++; } |
| 20 | else if (arg === '--type') { args.type = value; index++; } |
| 21 | else if (arg === '--query') { args.query = value; index++; } |
| 22 | else if (arg === '--json') args.json = true; |
| 23 | else if (arg === '--help' || arg === '-h') args.help = true; |
| 24 | } |
| 25 | return args; |
| 26 | } |
| 27 | |
| 28 | function usage() { |
| 29 | return [ |