@lotics/cli 0.156.0 → 0.156.1
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/dist/src/cli.js +30 -12
- package/package.json +1 -1
package/dist/src/cli.js
CHANGED
|
@@ -74508,6 +74508,8 @@ function parseArgs(argv) {
|
|
|
74508
74508
|
timezone: void 0,
|
|
74509
74509
|
message: void 0,
|
|
74510
74510
|
session: void 0,
|
|
74511
|
+
port: void 0,
|
|
74512
|
+
vitePort: void 0,
|
|
74511
74513
|
local: false,
|
|
74512
74514
|
all: false,
|
|
74513
74515
|
yes: false,
|
|
@@ -74521,6 +74523,7 @@ function parseArgs(argv) {
|
|
|
74521
74523
|
let subcommand;
|
|
74522
74524
|
let toolArgs;
|
|
74523
74525
|
const restArgs = [];
|
|
74526
|
+
let unknownFlag;
|
|
74524
74527
|
let i2 = 0;
|
|
74525
74528
|
while (i2 < argv.length) {
|
|
74526
74529
|
const arg = argv[i2];
|
|
@@ -74628,7 +74631,21 @@ function parseArgs(argv) {
|
|
|
74628
74631
|
case "-h":
|
|
74629
74632
|
flags.help = true;
|
|
74630
74633
|
break;
|
|
74631
|
-
default:
|
|
74634
|
+
default: {
|
|
74635
|
+
const port = /^--port=(\d+)$/.exec(arg);
|
|
74636
|
+
if (port) {
|
|
74637
|
+
flags.port = Number(port[1]);
|
|
74638
|
+
break;
|
|
74639
|
+
}
|
|
74640
|
+
const vitePort = /^--vite-port=(\d+)$/.exec(arg);
|
|
74641
|
+
if (vitePort) {
|
|
74642
|
+
flags.vitePort = Number(vitePort[1]);
|
|
74643
|
+
break;
|
|
74644
|
+
}
|
|
74645
|
+
if (arg.length > 1 && arg.startsWith("-")) {
|
|
74646
|
+
unknownFlag = arg;
|
|
74647
|
+
break;
|
|
74648
|
+
}
|
|
74632
74649
|
if (!command) {
|
|
74633
74650
|
command = arg;
|
|
74634
74651
|
} else if (!subcommand) {
|
|
@@ -74639,10 +74656,11 @@ function parseArgs(argv) {
|
|
|
74639
74656
|
restArgs.push(arg);
|
|
74640
74657
|
}
|
|
74641
74658
|
break;
|
|
74659
|
+
}
|
|
74642
74660
|
}
|
|
74643
74661
|
i2++;
|
|
74644
74662
|
}
|
|
74645
|
-
return { command, subcommand, toolArgs, restArgs, flags };
|
|
74663
|
+
return { command, subcommand, toolArgs, restArgs, flags, unknownFlag };
|
|
74646
74664
|
}
|
|
74647
74665
|
|
|
74648
74666
|
// src/inputs.ts
|
|
@@ -103510,6 +103528,11 @@ async function main() {
|
|
|
103510
103528
|
const parsed = parseArgs(process.argv.slice(2));
|
|
103511
103529
|
const { restArgs, flags } = parsed;
|
|
103512
103530
|
let { command, subcommand, toolArgs } = parsed;
|
|
103531
|
+
if (parsed.unknownFlag !== void 0) {
|
|
103532
|
+
console.error(`Unknown option: ${parsed.unknownFlag}`);
|
|
103533
|
+
console.error("Run 'lotics --help' for the options each command takes.");
|
|
103534
|
+
process.exit(1);
|
|
103535
|
+
}
|
|
103513
103536
|
if (command === "file") {
|
|
103514
103537
|
if (!subcommand) {
|
|
103515
103538
|
printHelp();
|
|
@@ -104135,16 +104158,11 @@ Available workspaces:`);
|
|
|
104135
104158
|
process.exit(1);
|
|
104136
104159
|
}
|
|
104137
104160
|
if (subcommand === "dev") {
|
|
104138
|
-
|
|
104139
|
-
|
|
104140
|
-
|
|
104141
|
-
|
|
104142
|
-
|
|
104143
|
-
const vitePortMatch = /^--vite-port=(\d+)$/.exec(a);
|
|
104144
|
-
if (portMatch) port = Number(portMatch[1]);
|
|
104145
|
-
else if (vitePortMatch) vitePort = Number(vitePortMatch[1]);
|
|
104146
|
-
}
|
|
104147
|
-
await appDev(client, { projectDir, port, vitePort });
|
|
104161
|
+
await appDev(client, {
|
|
104162
|
+
projectDir: toolArgs,
|
|
104163
|
+
port: flags.port,
|
|
104164
|
+
vitePort: flags.vitePort
|
|
104165
|
+
});
|
|
104148
104166
|
return;
|
|
104149
104167
|
}
|
|
104150
104168
|
console.error(`Unknown app subcommand: ${subcommand}`);
|