@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.
Files changed (2) hide show
  1. package/lib/index.js +9 -6
  2. 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, ...args] = operands;
20
- // your fallback logic
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: ${JSON.stringify(operands)}`);
23
- // e.g. route to a generic handler:
24
- // runFallback(cmd, args)
25
- process.exitCode = 1; // don’t exit immediately if you prefer
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()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mono-labs/cli",
3
- "version": "0.0.28",
3
+ "version": "0.0.30",
4
4
  "description": "A CLI tool for building and deploying projects",
5
5
  "type": "module",
6
6
  "main": "index.js",