@bagelink/workspace 1.7.65 → 1.7.69
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/bin/bgl.ts +22 -3
- package/dist/bin/bgl.cjs +15 -1
- package/dist/bin/bgl.mjs +15 -1
- package/package.json +1 -1
package/bin/bgl.ts
CHANGED
|
@@ -167,9 +167,28 @@ function parseFilterArgs(
|
|
|
167
167
|
argsList: string[] = [],
|
|
168
168
|
): { filter?: string, additionalArgs: string[] } {
|
|
169
169
|
const tokens = [subcommandArg, ...argsList].filter(Boolean) as string[]
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
170
|
+
|
|
171
|
+
// Flags that take values
|
|
172
|
+
const flagsWithValues = new Set(['--mode', '--host', '--port'])
|
|
173
|
+
|
|
174
|
+
// Find non-flag tokens (excluding flag values)
|
|
175
|
+
const nonFlagIndexes: number[] = []
|
|
176
|
+
for (let i = 0; i < tokens.length; i++) {
|
|
177
|
+
const token = tokens[i]
|
|
178
|
+
if (token.startsWith('-')) {
|
|
179
|
+
// If this flag takes a value, skip the next token
|
|
180
|
+
if (flagsWithValues.has(token)) {
|
|
181
|
+
i++ // Skip next token (the value)
|
|
182
|
+
}
|
|
183
|
+
} else {
|
|
184
|
+
// Not a flag and not a flag value
|
|
185
|
+
const prevToken = i > 0 ? tokens[i - 1] : null
|
|
186
|
+
if (!prevToken || !flagsWithValues.has(prevToken)) {
|
|
187
|
+
nonFlagIndexes.push(i)
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
173
192
|
const filterIndex = nonFlagIndexes.length > 0
|
|
174
193
|
? nonFlagIndexes[nonFlagIndexes.length - 1]
|
|
175
194
|
: -1
|
package/dist/bin/bgl.cjs
CHANGED
|
@@ -1281,7 +1281,21 @@ function normalizeFilter(input) {
|
|
|
1281
1281
|
}
|
|
1282
1282
|
function parseFilterArgs(defaultFilter, subcommandArg, argsList = []) {
|
|
1283
1283
|
const tokens = [subcommandArg, ...argsList].filter(Boolean);
|
|
1284
|
-
const
|
|
1284
|
+
const flagsWithValues = /* @__PURE__ */ new Set(["--mode", "--host", "--port"]);
|
|
1285
|
+
const nonFlagIndexes = [];
|
|
1286
|
+
for (let i = 0; i < tokens.length; i++) {
|
|
1287
|
+
const token = tokens[i];
|
|
1288
|
+
if (token.startsWith("-")) {
|
|
1289
|
+
if (flagsWithValues.has(token)) {
|
|
1290
|
+
i++;
|
|
1291
|
+
}
|
|
1292
|
+
} else {
|
|
1293
|
+
const prevToken = i > 0 ? tokens[i - 1] : null;
|
|
1294
|
+
if (!prevToken || !flagsWithValues.has(prevToken)) {
|
|
1295
|
+
nonFlagIndexes.push(i);
|
|
1296
|
+
}
|
|
1297
|
+
}
|
|
1298
|
+
}
|
|
1285
1299
|
const filterIndex = nonFlagIndexes.length > 0 ? nonFlagIndexes[nonFlagIndexes.length - 1] : -1;
|
|
1286
1300
|
const filter = filterIndex >= 0 ? normalizeFilter(tokens[filterIndex]) : defaultFilter;
|
|
1287
1301
|
const additionalArgs = filterIndex >= 0 ? tokens.filter((_, index) => index !== filterIndex) : tokens;
|
package/dist/bin/bgl.mjs
CHANGED
|
@@ -1274,7 +1274,21 @@ function normalizeFilter(input) {
|
|
|
1274
1274
|
}
|
|
1275
1275
|
function parseFilterArgs(defaultFilter, subcommandArg, argsList = []) {
|
|
1276
1276
|
const tokens = [subcommandArg, ...argsList].filter(Boolean);
|
|
1277
|
-
const
|
|
1277
|
+
const flagsWithValues = /* @__PURE__ */ new Set(["--mode", "--host", "--port"]);
|
|
1278
|
+
const nonFlagIndexes = [];
|
|
1279
|
+
for (let i = 0; i < tokens.length; i++) {
|
|
1280
|
+
const token = tokens[i];
|
|
1281
|
+
if (token.startsWith("-")) {
|
|
1282
|
+
if (flagsWithValues.has(token)) {
|
|
1283
|
+
i++;
|
|
1284
|
+
}
|
|
1285
|
+
} else {
|
|
1286
|
+
const prevToken = i > 0 ? tokens[i - 1] : null;
|
|
1287
|
+
if (!prevToken || !flagsWithValues.has(prevToken)) {
|
|
1288
|
+
nonFlagIndexes.push(i);
|
|
1289
|
+
}
|
|
1290
|
+
}
|
|
1291
|
+
}
|
|
1278
1292
|
const filterIndex = nonFlagIndexes.length > 0 ? nonFlagIndexes[nonFlagIndexes.length - 1] : -1;
|
|
1279
1293
|
const filter = filterIndex >= 0 ? normalizeFilter(tokens[filterIndex]) : defaultFilter;
|
|
1280
1294
|
const additionalArgs = filterIndex >= 0 ? tokens.filter((_, index) => index !== filterIndex) : tokens;
|
package/package.json
CHANGED