@optique/core 0.8.8-dev.282 → 0.8.8
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/primitives.cjs +10 -2
- package/dist/primitives.js +10 -2
- package/package.json +1 -1
package/dist/primitives.cjs
CHANGED
|
@@ -665,8 +665,16 @@ function command(name, parser, options = {}) {
|
|
|
665
665
|
success: false,
|
|
666
666
|
error: options.errors?.notFound ?? require_message.message`Command ${require_message.optionName(name)} was not matched.`
|
|
667
667
|
};
|
|
668
|
-
else if (state[0] === "matched")
|
|
669
|
-
|
|
668
|
+
else if (state[0] === "matched") {
|
|
669
|
+
const parseResult = parser.parse({
|
|
670
|
+
buffer: [],
|
|
671
|
+
optionsTerminated: false,
|
|
672
|
+
usage: [],
|
|
673
|
+
state: parser.initialState
|
|
674
|
+
});
|
|
675
|
+
if (parseResult.success) return parser.complete(parseResult.next.state);
|
|
676
|
+
return parser.complete(parser.initialState);
|
|
677
|
+
} else if (state[0] === "parsing") return parser.complete(state[1]);
|
|
670
678
|
return {
|
|
671
679
|
success: false,
|
|
672
680
|
error: options.errors?.invalidState ?? require_message.message`Invalid command state during completion.`
|
package/dist/primitives.js
CHANGED
|
@@ -665,8 +665,16 @@ function command(name, parser, options = {}) {
|
|
|
665
665
|
success: false,
|
|
666
666
|
error: options.errors?.notFound ?? message`Command ${optionName(name)} was not matched.`
|
|
667
667
|
};
|
|
668
|
-
else if (state[0] === "matched")
|
|
669
|
-
|
|
668
|
+
else if (state[0] === "matched") {
|
|
669
|
+
const parseResult = parser.parse({
|
|
670
|
+
buffer: [],
|
|
671
|
+
optionsTerminated: false,
|
|
672
|
+
usage: [],
|
|
673
|
+
state: parser.initialState
|
|
674
|
+
});
|
|
675
|
+
if (parseResult.success) return parser.complete(parseResult.next.state);
|
|
676
|
+
return parser.complete(parser.initialState);
|
|
677
|
+
} else if (state[0] === "parsing") return parser.complete(state[1]);
|
|
670
678
|
return {
|
|
671
679
|
success: false,
|
|
672
680
|
error: options.errors?.invalidState ?? message`Invalid command state during completion.`
|