@optique/run 0.4.0-dev.56 → 0.4.0-dev.58
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 +4 -1
- package/dist/run.d.cts +19 -0
- package/dist/run.d.ts +19 -0
- package/dist/run.js +4 -1
- package/package.json +1 -1
package/dist/run.cjs
CHANGED
|
@@ -54,7 +54,7 @@ const node_process = require_rolldown_runtime.__toESM(require("node:process"));
|
|
|
54
54
|
* ```
|
|
55
55
|
*/
|
|
56
56
|
function run(parser, options = {}) {
|
|
57
|
-
const { programName = 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, aboveError = "usage", errorExitCode = 1 } = options;
|
|
57
|
+
const { programName = 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, aboveError = "usage", errorExitCode = 1, brief, description, footer } = options;
|
|
58
58
|
const helpConfig = help ? {
|
|
59
59
|
mode: help,
|
|
60
60
|
onShow: () => node_process.default.exit(0)
|
|
@@ -71,6 +71,9 @@ function run(parser, options = {}) {
|
|
|
71
71
|
help: helpConfig,
|
|
72
72
|
version: versionConfig,
|
|
73
73
|
aboveError,
|
|
74
|
+
brief,
|
|
75
|
+
description,
|
|
76
|
+
footer,
|
|
74
77
|
onError() {
|
|
75
78
|
return node_process.default.exit(errorExitCode);
|
|
76
79
|
}
|
package/dist/run.d.cts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { InferValue, Parser } from "@optique/core/parser";
|
|
2
2
|
import { ShowDefaultOptions } from "@optique/core/doc";
|
|
3
|
+
import { Message } from "@optique/core/message";
|
|
3
4
|
|
|
4
5
|
//#region src/run.d.ts
|
|
5
6
|
|
|
@@ -84,6 +85,24 @@ interface RunOptions {
|
|
|
84
85
|
* @default `1`
|
|
85
86
|
*/
|
|
86
87
|
readonly errorExitCode?: number;
|
|
88
|
+
/**
|
|
89
|
+
* Brief description shown at the top of help text.
|
|
90
|
+
*
|
|
91
|
+
* @since 0.4.0
|
|
92
|
+
*/
|
|
93
|
+
readonly brief?: Message;
|
|
94
|
+
/**
|
|
95
|
+
* Detailed description shown after the usage line.
|
|
96
|
+
*
|
|
97
|
+
* @since 0.4.0
|
|
98
|
+
*/
|
|
99
|
+
readonly description?: Message;
|
|
100
|
+
/**
|
|
101
|
+
* Footer text shown at the bottom of help text.
|
|
102
|
+
*
|
|
103
|
+
* @since 0.4.0
|
|
104
|
+
*/
|
|
105
|
+
readonly footer?: Message;
|
|
87
106
|
}
|
|
88
107
|
/**
|
|
89
108
|
* Runs a command-line parser with automatic process integration.
|
package/dist/run.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Message } from "@optique/core/message";
|
|
1
2
|
import { InferValue, Parser } from "@optique/core/parser";
|
|
2
3
|
import { ShowDefaultOptions } from "@optique/core/doc";
|
|
3
4
|
|
|
@@ -84,6 +85,24 @@ interface RunOptions {
|
|
|
84
85
|
* @default `1`
|
|
85
86
|
*/
|
|
86
87
|
readonly errorExitCode?: number;
|
|
88
|
+
/**
|
|
89
|
+
* Brief description shown at the top of help text.
|
|
90
|
+
*
|
|
91
|
+
* @since 0.4.0
|
|
92
|
+
*/
|
|
93
|
+
readonly brief?: Message;
|
|
94
|
+
/**
|
|
95
|
+
* Detailed description shown after the usage line.
|
|
96
|
+
*
|
|
97
|
+
* @since 0.4.0
|
|
98
|
+
*/
|
|
99
|
+
readonly description?: Message;
|
|
100
|
+
/**
|
|
101
|
+
* Footer text shown at the bottom of help text.
|
|
102
|
+
*
|
|
103
|
+
* @since 0.4.0
|
|
104
|
+
*/
|
|
105
|
+
readonly footer?: Message;
|
|
87
106
|
}
|
|
88
107
|
/**
|
|
89
108
|
* Runs a command-line parser with automatic process integration.
|
package/dist/run.js
CHANGED
|
@@ -53,7 +53,7 @@ import process from "node:process";
|
|
|
53
53
|
* ```
|
|
54
54
|
*/
|
|
55
55
|
function run(parser, options = {}) {
|
|
56
|
-
const { programName = path.basename(process.argv[1] || "cli"), args = process.argv.slice(2), colors = process.stdout.isTTY, maxWidth = process.stdout.columns, showDefault, help, version, aboveError = "usage", errorExitCode = 1 } = options;
|
|
56
|
+
const { programName = path.basename(process.argv[1] || "cli"), args = process.argv.slice(2), colors = process.stdout.isTTY, maxWidth = process.stdout.columns, showDefault, help, version, aboveError = "usage", errorExitCode = 1, brief, description, footer } = options;
|
|
57
57
|
const helpConfig = help ? {
|
|
58
58
|
mode: help,
|
|
59
59
|
onShow: () => process.exit(0)
|
|
@@ -70,6 +70,9 @@ function run(parser, options = {}) {
|
|
|
70
70
|
help: helpConfig,
|
|
71
71
|
version: versionConfig,
|
|
72
72
|
aboveError,
|
|
73
|
+
brief,
|
|
74
|
+
description,
|
|
75
|
+
footer,
|
|
73
76
|
onError() {
|
|
74
77
|
return process.exit(errorExitCode);
|
|
75
78
|
}
|