@optique/core 0.9.10 → 0.9.11

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 CHANGED
@@ -498,6 +498,9 @@ function runParser(parser, programName, args, options = {}) {
498
498
  const helpAsCommand = help === "command" || help === "both";
499
499
  const versionAsCommand = version === "command" || version === "both";
500
500
  const completionAsCommand = completion === "command" || completion === "both";
501
+ const helpAsOption = help === "option" || help === "both";
502
+ const versionAsOption = version === "option" || version === "both";
503
+ const completionAsOption = completion === "option" || completion === "both";
501
504
  const requestedCommand = classified.commands[0];
502
505
  if ((requestedCommand === "completion" || requestedCommand === "completions") && completionAsCommand && completionParsers.completionCommand) helpGeneratorParser = completionParsers.completionCommand;
503
506
  else if (requestedCommand === "help" && helpAsCommand && helpParsers.helpCommand) helpGeneratorParser = helpParsers.helpCommand;
@@ -513,6 +516,9 @@ function runParser(parser, programName, args, options = {}) {
513
516
  if (completionAsCommand) {
514
517
  if (completionParsers.completionCommand) commandParsers.push(completionParsers.completionCommand);
515
518
  }
519
+ if (helpAsOption && helpParsers.helpOption) commandParsers.push(helpParsers.helpOption);
520
+ if (versionAsOption && versionParsers.versionOption) commandParsers.push(versionParsers.versionOption);
521
+ if (completionAsOption && completionParsers.completionOption) commandParsers.push(completionParsers.completionOption);
516
522
  if (commandParsers.length === 1) helpGeneratorParser = commandParsers[0];
517
523
  else if (commandParsers.length === 2) helpGeneratorParser = require_constructs.longestMatch(commandParsers[0], commandParsers[1]);
518
524
  else helpGeneratorParser = require_constructs.longestMatch(...commandParsers);
package/dist/facade.js CHANGED
@@ -498,6 +498,9 @@ function runParser(parser, programName, args, options = {}) {
498
498
  const helpAsCommand = help === "command" || help === "both";
499
499
  const versionAsCommand = version === "command" || version === "both";
500
500
  const completionAsCommand = completion === "command" || completion === "both";
501
+ const helpAsOption = help === "option" || help === "both";
502
+ const versionAsOption = version === "option" || version === "both";
503
+ const completionAsOption = completion === "option" || completion === "both";
501
504
  const requestedCommand = classified.commands[0];
502
505
  if ((requestedCommand === "completion" || requestedCommand === "completions") && completionAsCommand && completionParsers.completionCommand) helpGeneratorParser = completionParsers.completionCommand;
503
506
  else if (requestedCommand === "help" && helpAsCommand && helpParsers.helpCommand) helpGeneratorParser = helpParsers.helpCommand;
@@ -513,6 +516,9 @@ function runParser(parser, programName, args, options = {}) {
513
516
  if (completionAsCommand) {
514
517
  if (completionParsers.completionCommand) commandParsers.push(completionParsers.completionCommand);
515
518
  }
519
+ if (helpAsOption && helpParsers.helpOption) commandParsers.push(helpParsers.helpOption);
520
+ if (versionAsOption && versionParsers.versionOption) commandParsers.push(versionParsers.versionOption);
521
+ if (completionAsOption && completionParsers.completionOption) commandParsers.push(completionParsers.completionOption);
516
522
  if (commandParsers.length === 1) helpGeneratorParser = commandParsers[0];
517
523
  else if (commandParsers.length === 2) helpGeneratorParser = longestMatch(commandParsers[0], commandParsers[1]);
518
524
  else helpGeneratorParser = longestMatch(...commandParsers);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optique/core",
3
- "version": "0.9.10",
3
+ "version": "0.9.11",
4
4
  "description": "Type-safe combinatorial command-line interface parser",
5
5
  "keywords": [
6
6
  "CLI",