@mono-labs/cli 0.0.28 → 0.0.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +9 -6
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -16,12 +16,15 @@ import './commands/build-process/index.js'
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
program.on('command:*', (operands) => {
|
|
19
|
-
const [cmd
|
|
20
|
-
//
|
|
19
|
+
const [cmd] = operands; // e.g. "destroy3"
|
|
20
|
+
const raw = program.rawArgs.slice(2); // everything after `node script.js`
|
|
21
|
+
console.log('raw', raw);
|
|
22
|
+
const i = raw.indexOf(cmd);
|
|
23
|
+
const unknownWithArgs = i >= 0 ? raw.slice(i).join(' ') : operands.join(' ');
|
|
21
24
|
|
|
22
|
-
console.error(`Unknown command: ${
|
|
23
|
-
//
|
|
24
|
-
|
|
25
|
-
process.exitCode = 1; // don’t exit
|
|
25
|
+
console.error(`Unknown command: ${unknownWithArgs}`);
|
|
26
|
+
// -> "Unknown command: destroy3 --test --lot test"
|
|
27
|
+
|
|
28
|
+
process.exitCode = 1; // don’t hard-exit if you prefer
|
|
26
29
|
});
|
|
27
30
|
program.parse()
|