@optique/core 1.0.0-dev.556 → 1.0.0-dev.557
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/facade.cjs +2 -2
- package/dist/facade.js +2 -2
- package/dist/primitives.cjs +8 -5
- package/dist/primitives.js +8 -5
- package/package.json +1 -1
package/dist/facade.cjs
CHANGED
|
@@ -359,8 +359,8 @@ function classifyResult(result, args, helpOptionNames, helpCommandNames, version
|
|
|
359
359
|
if ((hasVersionOption || hasVersionCommand) && (parsedValue.version || parsedValue.versionFlag)) return { type: "version" };
|
|
360
360
|
if (parsedValue.completion && parsedValue.completionData) return {
|
|
361
361
|
type: "completion",
|
|
362
|
-
shell: parsedValue.completionData.shell
|
|
363
|
-
args: parsedValue.completionData.args
|
|
362
|
+
shell: parsedValue.completionData.shell ?? "",
|
|
363
|
+
args: parsedValue.completionData.args ?? []
|
|
364
364
|
};
|
|
365
365
|
return {
|
|
366
366
|
type: "success",
|
package/dist/facade.js
CHANGED
|
@@ -359,8 +359,8 @@ function classifyResult(result, args, helpOptionNames, helpCommandNames, version
|
|
|
359
359
|
if ((hasVersionOption || hasVersionCommand) && (parsedValue.version || parsedValue.versionFlag)) return { type: "version" };
|
|
360
360
|
if (parsedValue.completion && parsedValue.completionData) return {
|
|
361
361
|
type: "completion",
|
|
362
|
-
shell: parsedValue.completionData.shell
|
|
363
|
-
args: parsedValue.completionData.args
|
|
362
|
+
shell: parsedValue.completionData.shell ?? "",
|
|
363
|
+
args: parsedValue.completionData.args ?? []
|
|
364
364
|
};
|
|
365
365
|
return {
|
|
366
366
|
type: "success",
|
package/dist/primitives.cjs
CHANGED
|
@@ -401,11 +401,14 @@ function option(...args) {
|
|
|
401
401
|
const prefixes = optionNames$1.filter((name) => name.startsWith("--") || name.startsWith("/") || name.startsWith("-") && name.length > 2).map((name) => name.startsWith("/") ? `${name}:` : `${name}=`);
|
|
402
402
|
for (const prefix of prefixes) {
|
|
403
403
|
if (!context.buffer[0].startsWith(prefix)) continue;
|
|
404
|
-
if (context.state?.success && (valueParser != null || context.state.value))
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
404
|
+
if (context.state?.success && (valueParser != null || context.state.value)) {
|
|
405
|
+
const optionName$1 = prefix.slice(0, -1);
|
|
406
|
+
return {
|
|
407
|
+
success: false,
|
|
408
|
+
consumed: 1,
|
|
409
|
+
error: options.errors?.duplicate ? typeof options.errors.duplicate === "function" ? options.errors.duplicate(prefix) : options.errors.duplicate : require_message.message`${require_message.optionName(optionName$1)} cannot be used multiple times.`
|
|
410
|
+
};
|
|
411
|
+
}
|
|
409
412
|
const rawInput = context.buffer[0].slice(prefix.length);
|
|
410
413
|
if (valueParser == null) return {
|
|
411
414
|
success: false,
|
package/dist/primitives.js
CHANGED
|
@@ -401,11 +401,14 @@ function option(...args) {
|
|
|
401
401
|
const prefixes = optionNames$1.filter((name) => name.startsWith("--") || name.startsWith("/") || name.startsWith("-") && name.length > 2).map((name) => name.startsWith("/") ? `${name}:` : `${name}=`);
|
|
402
402
|
for (const prefix of prefixes) {
|
|
403
403
|
if (!context.buffer[0].startsWith(prefix)) continue;
|
|
404
|
-
if (context.state?.success && (valueParser != null || context.state.value))
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
404
|
+
if (context.state?.success && (valueParser != null || context.state.value)) {
|
|
405
|
+
const optionName$1 = prefix.slice(0, -1);
|
|
406
|
+
return {
|
|
407
|
+
success: false,
|
|
408
|
+
consumed: 1,
|
|
409
|
+
error: options.errors?.duplicate ? typeof options.errors.duplicate === "function" ? options.errors.duplicate(prefix) : options.errors.duplicate : message`${optionName(optionName$1)} cannot be used multiple times.`
|
|
410
|
+
};
|
|
411
|
+
}
|
|
409
412
|
const rawInput = context.buffer[0].slice(prefix.length);
|
|
410
413
|
if (valueParser == null) return {
|
|
411
414
|
success: false,
|