@optique/run 0.10.0-dev.369 → 0.10.0-dev.370

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/run.cjs CHANGED
@@ -32,7 +32,7 @@ function runImpl(parserOrProgram, options = {}) {
32
32
  footer: program.metadata.footer
33
33
  };
34
34
  } else parser = parserOrProgram;
35
- const { programName = programNameFromProgram ?? node_path.default.basename(node_process.default.argv[1] || "cli"), args = node_process.default.argv.slice(2), colors = node_process.default.stdout.isTTY, maxWidth = node_process.default.stdout.columns, showDefault, help, version, completion, aboveError = "usage", errorExitCode = 1, brief = programMetadata?.brief, description = programMetadata?.description, examples = programMetadata?.examples, author = programMetadata?.author, bugs = programMetadata?.bugs, footer = programMetadata?.footer } = options;
35
+ const { programName = programNameFromProgram ?? node_path.default.basename(node_process.default.argv[1] || "cli"), args = node_process.default.argv.slice(2), colors = node_process.default.stdout.isTTY, maxWidth = node_process.default.stdout.columns, showDefault, showChoices, help, version, completion, aboveError = "usage", errorExitCode = 1, brief = programMetadata?.brief, description = programMetadata?.description, examples = programMetadata?.examples, author = programMetadata?.author, bugs = programMetadata?.bugs, footer = programMetadata?.footer } = options;
36
36
  const helpConfig = help ? {
37
37
  mode: help,
38
38
  onShow: () => node_process.default.exit(0)
@@ -85,6 +85,7 @@ function runImpl(parserOrProgram, options = {}) {
85
85
  colors,
86
86
  maxWidth,
87
87
  showDefault,
88
+ showChoices,
88
89
  help: helpConfig,
89
90
  version: versionConfig,
90
91
  completion: completionConfig,
package/dist/run.d.cts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { ShellCompletion } from "@optique/core/completion";
2
2
  import { InferMode, InferValue, Mode, ModeValue, Parser } from "@optique/core/parser";
3
3
  import { Program } from "@optique/core/program";
4
- import { ShowDefaultOptions } from "@optique/core/doc";
4
+ import { ShowChoicesOptions, ShowDefaultOptions } from "@optique/core/doc";
5
5
  import { Message } from "@optique/core/message";
6
6
 
7
7
  //#region src/run.d.ts
@@ -47,6 +47,21 @@ interface RunOptions {
47
47
  * @since 0.4.0
48
48
  */
49
49
  readonly showDefault?: boolean | ShowDefaultOptions;
50
+ /**
51
+ * Whether and how to display valid choices for options and arguments
52
+ * backed by enumerated value parsers (e.g., `choice()`).
53
+ *
54
+ * - `boolean`: When `true`, displays choices using format
55
+ * `(choices: a, b, c)`
56
+ * - `ShowChoicesOptions`: Custom formatting with configurable prefix,
57
+ * suffix, label, and maximum number of items
58
+ *
59
+ * Choice values are automatically dimmed when `colors` is enabled.
60
+ *
61
+ * @default `false`
62
+ * @since 0.10.0
63
+ */
64
+ readonly showChoices?: boolean | ShowChoicesOptions;
50
65
  /**
51
66
  * Help configuration. Determines how help is made available:
52
67
  *
package/dist/run.d.ts CHANGED
@@ -2,7 +2,7 @@ import { Message } from "@optique/core/message";
2
2
  import { ShellCompletion } from "@optique/core/completion";
3
3
  import { InferMode, InferValue, Mode, ModeValue, Parser } from "@optique/core/parser";
4
4
  import { Program } from "@optique/core/program";
5
- import { ShowDefaultOptions } from "@optique/core/doc";
5
+ import { ShowChoicesOptions, ShowDefaultOptions } from "@optique/core/doc";
6
6
 
7
7
  //#region src/run.d.ts
8
8
 
@@ -47,6 +47,21 @@ interface RunOptions {
47
47
  * @since 0.4.0
48
48
  */
49
49
  readonly showDefault?: boolean | ShowDefaultOptions;
50
+ /**
51
+ * Whether and how to display valid choices for options and arguments
52
+ * backed by enumerated value parsers (e.g., `choice()`).
53
+ *
54
+ * - `boolean`: When `true`, displays choices using format
55
+ * `(choices: a, b, c)`
56
+ * - `ShowChoicesOptions`: Custom formatting with configurable prefix,
57
+ * suffix, label, and maximum number of items
58
+ *
59
+ * Choice values are automatically dimmed when `colors` is enabled.
60
+ *
61
+ * @default `false`
62
+ * @since 0.10.0
63
+ */
64
+ readonly showChoices?: boolean | ShowChoicesOptions;
50
65
  /**
51
66
  * Help configuration. Determines how help is made available:
52
67
  *
package/dist/run.js CHANGED
@@ -31,7 +31,7 @@ function runImpl(parserOrProgram, options = {}) {
31
31
  footer: program.metadata.footer
32
32
  };
33
33
  } else parser = parserOrProgram;
34
- const { programName = programNameFromProgram ?? path.basename(process.argv[1] || "cli"), args = process.argv.slice(2), colors = process.stdout.isTTY, maxWidth = process.stdout.columns, showDefault, help, version, completion, aboveError = "usage", errorExitCode = 1, brief = programMetadata?.brief, description = programMetadata?.description, examples = programMetadata?.examples, author = programMetadata?.author, bugs = programMetadata?.bugs, footer = programMetadata?.footer } = options;
34
+ const { programName = programNameFromProgram ?? path.basename(process.argv[1] || "cli"), args = process.argv.slice(2), colors = process.stdout.isTTY, maxWidth = process.stdout.columns, showDefault, showChoices, help, version, completion, aboveError = "usage", errorExitCode = 1, brief = programMetadata?.brief, description = programMetadata?.description, examples = programMetadata?.examples, author = programMetadata?.author, bugs = programMetadata?.bugs, footer = programMetadata?.footer } = options;
35
35
  const helpConfig = help ? {
36
36
  mode: help,
37
37
  onShow: () => process.exit(0)
@@ -84,6 +84,7 @@ function runImpl(parserOrProgram, options = {}) {
84
84
  colors,
85
85
  maxWidth,
86
86
  showDefault,
87
+ showChoices,
87
88
  help: helpConfig,
88
89
  version: versionConfig,
89
90
  completion: completionConfig,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optique/run",
3
- "version": "0.10.0-dev.369+ceed7dcf",
3
+ "version": "0.10.0-dev.370+bae705cb",
4
4
  "description": "Type-safe combinatorial command-line interface parser",
5
5
  "keywords": [
6
6
  "CLI",
@@ -70,7 +70,7 @@
70
70
  },
71
71
  "sideEffects": false,
72
72
  "dependencies": {
73
- "@optique/core": "0.10.0-dev.369+ceed7dcf"
73
+ "@optique/core": "0.10.0-dev.370+bae705cb"
74
74
  },
75
75
  "devDependencies": {
76
76
  "@types/node": "^20.19.9",