@optique/core 0.7.18-dev.409 → 0.7.19-dev.418
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 +6 -0
- package/dist/facade.js +6 -0
- package/package.json +1 -1
package/dist/facade.cjs
CHANGED
|
@@ -519,15 +519,21 @@ function run(parser, programName, args, options = {}) {
|
|
|
519
519
|
else if (requestedCommand === "version" && versionAsCommand && versionParsers.versionCommand) helpGeneratorParser = versionParsers.versionCommand;
|
|
520
520
|
else {
|
|
521
521
|
const commandParsers = [parser];
|
|
522
|
+
const helpAsOption = help === "option" || help === "both";
|
|
523
|
+
const versionAsOption = version === "option" || version === "both";
|
|
524
|
+
const completionAsOption = completion === "option" || completion === "both";
|
|
522
525
|
if (helpAsCommand) {
|
|
523
526
|
if (helpParsers.helpCommand) commandParsers.push(helpParsers.helpCommand);
|
|
524
527
|
}
|
|
528
|
+
if (helpAsOption && helpParsers.helpOption) commandParsers.push(helpParsers.helpOption);
|
|
525
529
|
if (versionAsCommand) {
|
|
526
530
|
if (versionParsers.versionCommand) commandParsers.push(versionParsers.versionCommand);
|
|
527
531
|
}
|
|
532
|
+
if (versionAsOption && versionParsers.versionOption) commandParsers.push(versionParsers.versionOption);
|
|
528
533
|
if (completionAsCommand) {
|
|
529
534
|
if (completionParsers.completionCommand) commandParsers.push(completionParsers.completionCommand);
|
|
530
535
|
}
|
|
536
|
+
if (completionAsOption && completionParsers.completionOption) commandParsers.push(completionParsers.completionOption);
|
|
531
537
|
if (commandParsers.length === 1) helpGeneratorParser = commandParsers[0];
|
|
532
538
|
else if (commandParsers.length === 2) helpGeneratorParser = require_constructs.longestMatch(commandParsers[0], commandParsers[1]);
|
|
533
539
|
else helpGeneratorParser = require_constructs.longestMatch(...commandParsers);
|
package/dist/facade.js
CHANGED
|
@@ -519,15 +519,21 @@ function run(parser, programName, args, options = {}) {
|
|
|
519
519
|
else if (requestedCommand === "version" && versionAsCommand && versionParsers.versionCommand) helpGeneratorParser = versionParsers.versionCommand;
|
|
520
520
|
else {
|
|
521
521
|
const commandParsers = [parser];
|
|
522
|
+
const helpAsOption = help === "option" || help === "both";
|
|
523
|
+
const versionAsOption = version === "option" || version === "both";
|
|
524
|
+
const completionAsOption = completion === "option" || completion === "both";
|
|
522
525
|
if (helpAsCommand) {
|
|
523
526
|
if (helpParsers.helpCommand) commandParsers.push(helpParsers.helpCommand);
|
|
524
527
|
}
|
|
528
|
+
if (helpAsOption && helpParsers.helpOption) commandParsers.push(helpParsers.helpOption);
|
|
525
529
|
if (versionAsCommand) {
|
|
526
530
|
if (versionParsers.versionCommand) commandParsers.push(versionParsers.versionCommand);
|
|
527
531
|
}
|
|
532
|
+
if (versionAsOption && versionParsers.versionOption) commandParsers.push(versionParsers.versionOption);
|
|
528
533
|
if (completionAsCommand) {
|
|
529
534
|
if (completionParsers.completionCommand) commandParsers.push(completionParsers.completionCommand);
|
|
530
535
|
}
|
|
536
|
+
if (completionAsOption && completionParsers.completionOption) commandParsers.push(completionParsers.completionOption);
|
|
531
537
|
if (commandParsers.length === 1) helpGeneratorParser = commandParsers[0];
|
|
532
538
|
else if (commandParsers.length === 2) helpGeneratorParser = longestMatch(commandParsers[0], commandParsers[1]);
|
|
533
539
|
else helpGeneratorParser = longestMatch(...commandParsers);
|