@cordfuse/crosstalk 7.0.0-alpha.8 → 7.0.0-alpha.9
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/commands/run.js +6 -13
- package/package.json +1 -1
package/commands/run.js
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
import { readFileSync, existsSync, statSync } from 'fs';
|
|
11
11
|
import { apiFor } from '../lib/api-client.js';
|
|
12
12
|
import { reportAndExit } from '../lib/errors.js';
|
|
13
|
-
import { flag, has } from '../lib/argv.js';
|
|
13
|
+
import { flag, has, positionals } from '../lib/argv.js';
|
|
14
14
|
|
|
15
15
|
const FLAGS_WITH_VALUE = new Set(['--type', '--to', '--as', '--fanout', '--channel', '--from', '--containername', '-c']);
|
|
16
16
|
|
|
@@ -56,18 +56,11 @@ export async function run(argv) {
|
|
|
56
56
|
const type = flag(argv, '--type');
|
|
57
57
|
if (type !== 'primitive' && type !== 'workflow') usage(1);
|
|
58
58
|
|
|
59
|
-
//
|
|
60
|
-
// flag
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
if (a.startsWith('-')) break;
|
|
65
|
-
// Make sure we're not the value of a flag like `--to <value>`
|
|
66
|
-
const prev = argv[i - 1];
|
|
67
|
-
if (prev && FLAGS_WITH_VALUE.has(prev)) continue;
|
|
68
|
-
bodyArg = a;
|
|
69
|
-
break;
|
|
70
|
-
}
|
|
59
|
+
// Body is the last positional. positionals() skips flag values so the
|
|
60
|
+
// body resolves regardless of flag order — `--containername a8 hello`
|
|
61
|
+
// and `hello --containername a8` both work.
|
|
62
|
+
const pos = positionals(argv, [...FLAGS_WITH_VALUE]);
|
|
63
|
+
const bodyArg = pos[pos.length - 1];
|
|
71
64
|
|
|
72
65
|
const body = resolveBody(bodyArg);
|
|
73
66
|
if (body == null || body.length === 0) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cordfuse/crosstalk",
|
|
3
|
-
"version": "7.0.0-alpha.
|
|
3
|
+
"version": "7.0.0-alpha.9",
|
|
4
4
|
"description": "Crosstalk client — host-side CLI that talks to the crosstalkd daemon running inside the crosstalk-server container.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|