@optique/run 1.4.0-dev.2614 → 1.4.0-dev.2618

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
@@ -83,6 +83,7 @@ function buildCoreOptions(options, programMetadata) {
83
83
  const usageLine = options.usageLine;
84
84
  const commandList = options.commandList;
85
85
  const sectionOrder = options.sectionOrder;
86
+ const helpSections = options.helpSections;
86
87
  const help = options.help;
87
88
  const version = options.version;
88
89
  const completion = options.completion;
@@ -165,6 +166,7 @@ function buildCoreOptions(options, programMetadata) {
165
166
  usageLine,
166
167
  commandList,
167
168
  sectionOrder,
169
+ helpSections,
168
170
  help: helpConfig,
169
171
  version: versionConfig,
170
172
  completion: completionConfig,
package/dist/run.d.cts CHANGED
@@ -2,7 +2,7 @@ import { Message, MessageFormatter } from "@optique/core/message";
2
2
  import { TerminalTheme } from "@optique/core/terminal";
3
3
  import { ShellCompletion } from "@optique/core/completion";
4
4
  import { SourceContext } from "@optique/core/context";
5
- import { CommandListMode, CommandSubConfig, ContextOptionsParam, OptionSubConfig, RunOptions as RunOptions$1 } from "@optique/core/facade";
5
+ import { CommandListMode, CommandSubConfig, ContextOptionsParam, HelpSectionsOptions, OptionSubConfig, RunOptions as RunOptions$1 } from "@optique/core/facade";
6
6
  import { InferMode, InferValue, Mode, ModeValue, Parser } from "@optique/core/parser";
7
7
  import { Program } from "@optique/core/program";
8
8
  import { DocSection, ShowChoicesOptions, ShowDefaultOptions } from "@optique/core/doc";
@@ -156,6 +156,16 @@ interface RunOptions {
156
156
  * @since 1.0.0
157
157
  */
158
158
  readonly sectionOrder?: (a: DocSection, b: DocSection) => number;
159
+ /**
160
+ * Groups untitled command and option entries on help pages with visible
161
+ * commands. Pages without commands receive no automatic headings. Explicit
162
+ * titles are preserved; matching automatic entries join the existing section.
163
+ * Supplied labels must be nonempty and contain no control characters.
164
+ * Also applies to full help displayed above errors.
165
+ *
166
+ * @since 1.4.0
167
+ */
168
+ readonly helpSections?: HelpSectionsOptions;
159
169
  /**
160
170
  * Help configuration. Determines how help is made available:
161
171
  *
@@ -354,6 +364,7 @@ type AcceptExactOptionalRunOptions<TOptions> = [TOptions] extends [RunOptions |
354
364
  * See {@link RunOptions} for available settings.
355
365
  * @throws {RangeError} If rendering help or errors encounters an invalid theme
356
366
  * color, even when colors are disabled.
367
+ * @throws {TypeError} If a `helpSections` label is invalid.
357
368
  * @returns The parsed result if successful. On help display or parse errors,
358
369
  * the function will call `process.exit()` and not return.
359
370
  *
@@ -435,6 +446,7 @@ declare function run<T extends Parser<Mode, unknown, unknown>>(parser: T, option
435
446
  * @param options Configuration options for customizing behavior.
436
447
  * @throws {RangeError} If rendering help or errors encounters an invalid theme
437
448
  * color, even when colors are disabled.
449
+ * @throws {TypeError} If a `helpSections` label is invalid.
438
450
  * @returns The parsed result if successful.
439
451
  * @throws {TypeError} If an async parser (or a {@link Program} wrapping one)
440
452
  * is passed at runtime. Use {@link run} or {@link runAsync} instead.
@@ -462,6 +474,7 @@ declare function runSync<T extends Parser<"sync", unknown, unknown>>(parser: T,
462
474
  * @param options Configuration options for customizing behavior.
463
475
  * @throws {RangeError} If rendering help or errors encounters an invalid theme
464
476
  * color, even when colors are disabled.
477
+ * @throws {TypeError} If a `helpSections` label is invalid.
465
478
  * @returns A Promise of the parsed result if successful.
466
479
  * @since 0.9.0
467
480
  */
package/dist/run.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { CommandListMode, CommandSubConfig, ContextOptionsParam, OptionSubConfig, RunOptions as RunOptions$1 } from "@optique/core/facade";
1
+ import { CommandListMode, CommandSubConfig, ContextOptionsParam, HelpSectionsOptions, OptionSubConfig, RunOptions as RunOptions$1 } from "@optique/core/facade";
2
2
  import { Message, MessageFormatter } from "@optique/core/message";
3
3
  import { TerminalTheme } from "@optique/core/terminal";
4
4
  import { ShellCompletion } from "@optique/core/completion";
@@ -156,6 +156,16 @@ interface RunOptions {
156
156
  * @since 1.0.0
157
157
  */
158
158
  readonly sectionOrder?: (a: DocSection, b: DocSection) => number;
159
+ /**
160
+ * Groups untitled command and option entries on help pages with visible
161
+ * commands. Pages without commands receive no automatic headings. Explicit
162
+ * titles are preserved; matching automatic entries join the existing section.
163
+ * Supplied labels must be nonempty and contain no control characters.
164
+ * Also applies to full help displayed above errors.
165
+ *
166
+ * @since 1.4.0
167
+ */
168
+ readonly helpSections?: HelpSectionsOptions;
159
169
  /**
160
170
  * Help configuration. Determines how help is made available:
161
171
  *
@@ -354,6 +364,7 @@ type AcceptExactOptionalRunOptions<TOptions> = [TOptions] extends [RunOptions |
354
364
  * See {@link RunOptions} for available settings.
355
365
  * @throws {RangeError} If rendering help or errors encounters an invalid theme
356
366
  * color, even when colors are disabled.
367
+ * @throws {TypeError} If a `helpSections` label is invalid.
357
368
  * @returns The parsed result if successful. On help display or parse errors,
358
369
  * the function will call `process.exit()` and not return.
359
370
  *
@@ -435,6 +446,7 @@ declare function run<T extends Parser<Mode, unknown, unknown>>(parser: T, option
435
446
  * @param options Configuration options for customizing behavior.
436
447
  * @throws {RangeError} If rendering help or errors encounters an invalid theme
437
448
  * color, even when colors are disabled.
449
+ * @throws {TypeError} If a `helpSections` label is invalid.
438
450
  * @returns The parsed result if successful.
439
451
  * @throws {TypeError} If an async parser (or a {@link Program} wrapping one)
440
452
  * is passed at runtime. Use {@link run} or {@link runAsync} instead.
@@ -462,6 +474,7 @@ declare function runSync<T extends Parser<"sync", unknown, unknown>>(parser: T,
462
474
  * @param options Configuration options for customizing behavior.
463
475
  * @throws {RangeError} If rendering help or errors encounters an invalid theme
464
476
  * color, even when colors are disabled.
477
+ * @throws {TypeError} If a `helpSections` label is invalid.
465
478
  * @returns A Promise of the parsed result if successful.
466
479
  * @since 0.9.0
467
480
  */
package/dist/run.js CHANGED
@@ -82,6 +82,7 @@ function buildCoreOptions(options, programMetadata) {
82
82
  const usageLine = options.usageLine;
83
83
  const commandList = options.commandList;
84
84
  const sectionOrder = options.sectionOrder;
85
+ const helpSections = options.helpSections;
85
86
  const help = options.help;
86
87
  const version = options.version;
87
88
  const completion = options.completion;
@@ -164,6 +165,7 @@ function buildCoreOptions(options, programMetadata) {
164
165
  usageLine,
165
166
  commandList,
166
167
  sectionOrder,
168
+ helpSections,
167
169
  help: helpConfig,
168
170
  version: versionConfig,
169
171
  completion: completionConfig,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optique/run",
3
- "version": "1.4.0-dev.2614",
3
+ "version": "1.4.0-dev.2618",
4
4
  "description": "Type-safe combinatorial command-line interface parser",
5
5
  "keywords": [
6
6
  "CLI",
@@ -76,11 +76,11 @@
76
76
  },
77
77
  "sideEffects": false,
78
78
  "dependencies": {
79
- "@optique/core": "1.4.0-dev.2614+5915742e"
79
+ "@optique/core": "1.4.0-dev.2618+2cb27efe"
80
80
  },
81
81
  "devDependencies": {
82
- "@optique/config": "1.4.0-dev.2614+5915742e",
83
- "@optique/env": "1.4.0-dev.2614+5915742e",
82
+ "@optique/config": "1.4.0-dev.2618+2cb27efe",
83
+ "@optique/env": "1.4.0-dev.2618+2cb27efe",
84
84
  "@types/node": "^24.0.0",
85
85
  "fast-check": "^4.7.0",
86
86
  "tsdown": "^0.13.0",