@optique/core 0.3.0-dev.43 → 0.3.0-dev.45
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 +8 -1
- package/dist/facade.js +8 -1
- package/package.json +1 -1
package/dist/facade.cjs
CHANGED
|
@@ -275,7 +275,14 @@ function run(parser, programName, args, options = {}) {
|
|
|
275
275
|
let commandContext = [];
|
|
276
276
|
if (Array.isArray(parsedValue.commands)) commandContext = parsedValue.commands;
|
|
277
277
|
else if (typeof parsedValue.commands === "object" && parsedValue.commands != null && "length" in parsedValue.commands) commandContext = parsedValue.commands;
|
|
278
|
-
|
|
278
|
+
let helpGeneratorParser;
|
|
279
|
+
const helpAsCommand = help === "command" || help === "both";
|
|
280
|
+
const versionAsCommand = version === "command" || version === "both";
|
|
281
|
+
if (helpAsCommand && versionAsCommand) helpGeneratorParser = require_parser.longestMatch(parser, helpCommand, versionCommand);
|
|
282
|
+
else if (helpAsCommand) helpGeneratorParser = require_parser.longestMatch(parser, helpCommand);
|
|
283
|
+
else if (versionAsCommand) helpGeneratorParser = require_parser.longestMatch(parser, versionCommand);
|
|
284
|
+
else helpGeneratorParser = parser;
|
|
285
|
+
const doc = require_parser.getDocPage(commandContext.length < 1 ? helpGeneratorParser : parser, commandContext);
|
|
279
286
|
if (doc != null) stdout(require_doc.formatDocPage(programName, doc, {
|
|
280
287
|
colors,
|
|
281
288
|
maxWidth
|
package/dist/facade.js
CHANGED
|
@@ -275,7 +275,14 @@ function run(parser, programName, args, options = {}) {
|
|
|
275
275
|
let commandContext = [];
|
|
276
276
|
if (Array.isArray(parsedValue.commands)) commandContext = parsedValue.commands;
|
|
277
277
|
else if (typeof parsedValue.commands === "object" && parsedValue.commands != null && "length" in parsedValue.commands) commandContext = parsedValue.commands;
|
|
278
|
-
|
|
278
|
+
let helpGeneratorParser;
|
|
279
|
+
const helpAsCommand = help === "command" || help === "both";
|
|
280
|
+
const versionAsCommand = version === "command" || version === "both";
|
|
281
|
+
if (helpAsCommand && versionAsCommand) helpGeneratorParser = longestMatch(parser, helpCommand, versionCommand);
|
|
282
|
+
else if (helpAsCommand) helpGeneratorParser = longestMatch(parser, helpCommand);
|
|
283
|
+
else if (versionAsCommand) helpGeneratorParser = longestMatch(parser, versionCommand);
|
|
284
|
+
else helpGeneratorParser = parser;
|
|
285
|
+
const doc = getDocPage(commandContext.length < 1 ? helpGeneratorParser : parser, commandContext);
|
|
279
286
|
if (doc != null) stdout(formatDocPage(programName, doc, {
|
|
280
287
|
colors,
|
|
281
288
|
maxWidth
|