(argv)
| 108 | * Get "command" and "options" from argv |
| 109 | */ |
| 110 | const extractCommandsAndOptions = (argv) => { |
| 111 | const command = argv._ |
| 112 | const options = argv |
| 113 | delete options._ |
| 114 | delete options.$0 |
| 115 | if (options.debug === true) { |
| 116 | options.debug = '*' |
| 117 | } |
| 118 | |
| 119 | // Normalize multi-value options for specific commands. |
| 120 | // For "invoke local", ensure --env / -e are always treated as arrays, |
| 121 | // matching the "multiple" type in the Framework command schema. |
| 122 | if (command[0] === 'invoke' && command[1] === 'local') { |
| 123 | if (options.env && !Array.isArray(options.env)) { |
| 124 | options.env = [options.env] |
| 125 | } |
| 126 | if (options.e && !Array.isArray(options.e)) { |
| 127 | options.e = [options.e] |
| 128 | } |
| 129 | } |
| 130 | return { command, options } |
| 131 | } |
| 132 | |
| 133 | export { validateCliSchema, commandExist, extractCommandsAndOptions } |
no outgoing calls
no test coverage detected
searching dependent graphs…