@optique/core 0.9.0-dev.187 → 0.9.0-dev.195
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/constructs.cjs +5 -2
- package/dist/constructs.js +5 -2
- package/dist/facade.cjs +3 -3
- package/dist/facade.js +3 -3
- package/dist/primitives.cjs +4 -1
- package/dist/primitives.js +4 -1
- package/package.json +1 -1
package/dist/constructs.cjs
CHANGED
|
@@ -670,8 +670,11 @@ function merge(...args) {
|
|
|
670
670
|
for (let i = 0; i < parsers.length; i++) {
|
|
671
671
|
const parser = parsers[i];
|
|
672
672
|
let parserState;
|
|
673
|
-
if (parser.initialState === void 0)
|
|
674
|
-
|
|
673
|
+
if (parser.initialState === void 0) {
|
|
674
|
+
const key = `__parser_${i}`;
|
|
675
|
+
if (context.state && typeof context.state === "object" && key in context.state) parserState = context.state[key];
|
|
676
|
+
else parserState = void 0;
|
|
677
|
+
} else if (parser.initialState && typeof parser.initialState === "object") if (context.state && typeof context.state === "object") {
|
|
675
678
|
const extractedState = {};
|
|
676
679
|
for (const field in parser.initialState) extractedState[field] = field in context.state ? context.state[field] : parser.initialState[field];
|
|
677
680
|
parserState = extractedState;
|
package/dist/constructs.js
CHANGED
|
@@ -670,8 +670,11 @@ function merge(...args) {
|
|
|
670
670
|
for (let i = 0; i < parsers.length; i++) {
|
|
671
671
|
const parser = parsers[i];
|
|
672
672
|
let parserState;
|
|
673
|
-
if (parser.initialState === void 0)
|
|
674
|
-
|
|
673
|
+
if (parser.initialState === void 0) {
|
|
674
|
+
const key = `__parser_${i}`;
|
|
675
|
+
if (context.state && typeof context.state === "object" && key in context.state) parserState = context.state[key];
|
|
676
|
+
else parserState = void 0;
|
|
677
|
+
} else if (parser.initialState && typeof parser.initialState === "object") if (context.state && typeof context.state === "object") {
|
|
675
678
|
const extractedState = {};
|
|
676
679
|
for (const field in parser.initialState) extractedState[field] = field in context.state ? context.state[field] : parser.initialState[field];
|
|
677
680
|
parserState = extractedState;
|
package/dist/facade.cjs
CHANGED
|
@@ -13,7 +13,7 @@ const require_parser = require('./parser.cjs');
|
|
|
13
13
|
* Creates help parsers based on the specified mode.
|
|
14
14
|
*/
|
|
15
15
|
function createHelpParser(mode) {
|
|
16
|
-
const helpCommand = require_primitives.command("help", require_modifiers.multiple(require_primitives.argument(require_valueparser.string({ metavar: "COMMAND" }))), { description: require_message.message`Show help information.` });
|
|
16
|
+
const helpCommand = require_primitives.command("help", require_modifiers.multiple(require_primitives.argument(require_valueparser.string({ metavar: "COMMAND" }), { description: require_message.message`Command name to show help for.` })), { description: require_message.message`Show help information.` });
|
|
17
17
|
const helpOption = require_primitives.flag("--help", { description: require_message.message`Show help information.` });
|
|
18
18
|
switch (mode) {
|
|
19
19
|
case "command": return {
|
|
@@ -98,14 +98,14 @@ function createCompletionParser(mode, programName, availableShells, name = "both
|
|
|
98
98
|
completionCommand: null,
|
|
99
99
|
completionOption: require_constructs.object({
|
|
100
100
|
shell: completionOption,
|
|
101
|
-
args: require_modifiers.withDefault(require_modifiers.multiple(require_primitives.argument(require_valueparser.string({ metavar: "ARG" }))), [])
|
|
101
|
+
args: require_modifiers.withDefault(require_modifiers.multiple(require_primitives.argument(require_valueparser.string({ metavar: "ARG" }), { description: require_message.message`Command line arguments for completion suggestions (used by shell integration; you usually don't need to provide this).` })), [])
|
|
102
102
|
})
|
|
103
103
|
};
|
|
104
104
|
case "both": return {
|
|
105
105
|
completionCommand,
|
|
106
106
|
completionOption: require_constructs.object({
|
|
107
107
|
shell: completionOption,
|
|
108
|
-
args: require_modifiers.withDefault(require_modifiers.multiple(require_primitives.argument(require_valueparser.string({ metavar: "ARG" }))), [])
|
|
108
|
+
args: require_modifiers.withDefault(require_modifiers.multiple(require_primitives.argument(require_valueparser.string({ metavar: "ARG" }), { description: require_message.message`Command line arguments for completion suggestions (used by shell integration; you usually don't need to provide this).` })), [])
|
|
109
109
|
})
|
|
110
110
|
};
|
|
111
111
|
}
|
package/dist/facade.js
CHANGED
|
@@ -13,7 +13,7 @@ import { getDocPage, parse, suggest } from "./parser.js";
|
|
|
13
13
|
* Creates help parsers based on the specified mode.
|
|
14
14
|
*/
|
|
15
15
|
function createHelpParser(mode) {
|
|
16
|
-
const helpCommand = command("help", multiple(argument(string({ metavar: "COMMAND" }))), { description: message`Show help information.` });
|
|
16
|
+
const helpCommand = command("help", multiple(argument(string({ metavar: "COMMAND" }), { description: message`Command name to show help for.` })), { description: message`Show help information.` });
|
|
17
17
|
const helpOption = flag("--help", { description: message`Show help information.` });
|
|
18
18
|
switch (mode) {
|
|
19
19
|
case "command": return {
|
|
@@ -98,14 +98,14 @@ function createCompletionParser(mode, programName, availableShells, name = "both
|
|
|
98
98
|
completionCommand: null,
|
|
99
99
|
completionOption: object({
|
|
100
100
|
shell: completionOption,
|
|
101
|
-
args: withDefault(multiple(argument(string({ metavar: "ARG" }))), [])
|
|
101
|
+
args: withDefault(multiple(argument(string({ metavar: "ARG" }), { description: message`Command line arguments for completion suggestions (used by shell integration; you usually don't need to provide this).` })), [])
|
|
102
102
|
})
|
|
103
103
|
};
|
|
104
104
|
case "both": return {
|
|
105
105
|
completionCommand,
|
|
106
106
|
completionOption: object({
|
|
107
107
|
shell: completionOption,
|
|
108
|
-
args: withDefault(multiple(argument(string({ metavar: "ARG" }))), [])
|
|
108
|
+
args: withDefault(multiple(argument(string({ metavar: "ARG" }), { description: message`Command line arguments for completion suggestions (used by shell integration; you usually don't need to provide this).` })), [])
|
|
109
109
|
})
|
|
110
110
|
};
|
|
111
111
|
}
|
package/dist/primitives.cjs
CHANGED
|
@@ -735,7 +735,10 @@ function command(name, parser, options = {}) {
|
|
|
735
735
|
const innerState = state.state[0] === "parsing" ? {
|
|
736
736
|
kind: "available",
|
|
737
737
|
state: state.state[1]
|
|
738
|
-
} : {
|
|
738
|
+
} : {
|
|
739
|
+
kind: "available",
|
|
740
|
+
state: parser.initialState
|
|
741
|
+
};
|
|
739
742
|
const innerFragments = parser.getDocFragments(innerState, defaultValue);
|
|
740
743
|
return {
|
|
741
744
|
...innerFragments,
|
package/dist/primitives.js
CHANGED
|
@@ -735,7 +735,10 @@ function command(name, parser, options = {}) {
|
|
|
735
735
|
const innerState = state.state[0] === "parsing" ? {
|
|
736
736
|
kind: "available",
|
|
737
737
|
state: state.state[1]
|
|
738
|
-
} : {
|
|
738
|
+
} : {
|
|
739
|
+
kind: "available",
|
|
740
|
+
state: parser.initialState
|
|
741
|
+
};
|
|
739
742
|
const innerFragments = parser.getDocFragments(innerState, defaultValue);
|
|
740
743
|
return {
|
|
741
744
|
...innerFragments,
|