@optique/run 1.0.0-dev.479 → 1.0.0-dev.487
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 +23 -3
- package/dist/run.js +23 -3
- package/package.json +2 -2
package/dist/run.cjs
CHANGED
|
@@ -55,11 +55,31 @@ function runAsync(parserOrProgram, options = {}) {
|
|
|
55
55
|
* @internal
|
|
56
56
|
*/
|
|
57
57
|
function buildCoreOptions(options, programMetadata) {
|
|
58
|
-
const
|
|
58
|
+
const programName = options.programName ?? node_path.default.basename(node_process.default.argv[1] ?? "cli");
|
|
59
|
+
const args = options.args ?? node_process.default.argv.slice(2);
|
|
60
|
+
const stdout = options.stdout ?? ((line) => {
|
|
59
61
|
node_process.default.stdout.write(`${line}\n`);
|
|
60
|
-
}
|
|
62
|
+
});
|
|
63
|
+
const stderr = options.stderr ?? ((line) => {
|
|
61
64
|
node_process.default.stderr.write(`${line}\n`);
|
|
62
|
-
}
|
|
65
|
+
});
|
|
66
|
+
const onExit = options.onExit ?? ((exitCode) => node_process.default.exit(exitCode));
|
|
67
|
+
const colors = options.colors ?? node_process.default.stdout.isTTY;
|
|
68
|
+
const maxWidth = options.maxWidth ?? node_process.default.stdout.columns;
|
|
69
|
+
const showDefault = options.showDefault;
|
|
70
|
+
const showChoices = options.showChoices;
|
|
71
|
+
const sectionOrder = options.sectionOrder;
|
|
72
|
+
const help = options.help;
|
|
73
|
+
const version = options.version;
|
|
74
|
+
const completion = options.completion;
|
|
75
|
+
const aboveError = options.aboveError ?? "usage";
|
|
76
|
+
const errorExitCode = options.errorExitCode ?? 1;
|
|
77
|
+
const brief = options.brief ?? programMetadata?.brief;
|
|
78
|
+
const description = options.description ?? programMetadata?.description;
|
|
79
|
+
const examples = options.examples ?? programMetadata?.examples;
|
|
80
|
+
const author = options.author ?? programMetadata?.author;
|
|
81
|
+
const bugs = options.bugs ?? programMetadata?.bugs;
|
|
82
|
+
const footer = options.footer ?? programMetadata?.footer;
|
|
63
83
|
const onShow = () => onExit(0);
|
|
64
84
|
const helpConfig = (() => {
|
|
65
85
|
if (!help) return void 0;
|
package/dist/run.js
CHANGED
|
@@ -54,11 +54,31 @@ function runAsync(parserOrProgram, options = {}) {
|
|
|
54
54
|
* @internal
|
|
55
55
|
*/
|
|
56
56
|
function buildCoreOptions(options, programMetadata) {
|
|
57
|
-
const
|
|
57
|
+
const programName = options.programName ?? path.basename(process.argv[1] ?? "cli");
|
|
58
|
+
const args = options.args ?? process.argv.slice(2);
|
|
59
|
+
const stdout = options.stdout ?? ((line) => {
|
|
58
60
|
process.stdout.write(`${line}\n`);
|
|
59
|
-
}
|
|
61
|
+
});
|
|
62
|
+
const stderr = options.stderr ?? ((line) => {
|
|
60
63
|
process.stderr.write(`${line}\n`);
|
|
61
|
-
}
|
|
64
|
+
});
|
|
65
|
+
const onExit = options.onExit ?? ((exitCode) => process.exit(exitCode));
|
|
66
|
+
const colors = options.colors ?? process.stdout.isTTY;
|
|
67
|
+
const maxWidth = options.maxWidth ?? process.stdout.columns;
|
|
68
|
+
const showDefault = options.showDefault;
|
|
69
|
+
const showChoices = options.showChoices;
|
|
70
|
+
const sectionOrder = options.sectionOrder;
|
|
71
|
+
const help = options.help;
|
|
72
|
+
const version = options.version;
|
|
73
|
+
const completion = options.completion;
|
|
74
|
+
const aboveError = options.aboveError ?? "usage";
|
|
75
|
+
const errorExitCode = options.errorExitCode ?? 1;
|
|
76
|
+
const brief = options.brief ?? programMetadata?.brief;
|
|
77
|
+
const description = options.description ?? programMetadata?.description;
|
|
78
|
+
const examples = options.examples ?? programMetadata?.examples;
|
|
79
|
+
const author = options.author ?? programMetadata?.author;
|
|
80
|
+
const bugs = options.bugs ?? programMetadata?.bugs;
|
|
81
|
+
const footer = options.footer ?? programMetadata?.footer;
|
|
62
82
|
const onShow = () => onExit(0);
|
|
63
83
|
const helpConfig = (() => {
|
|
64
84
|
if (!help) return void 0;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@optique/run",
|
|
3
|
-
"version": "1.0.0-dev.
|
|
3
|
+
"version": "1.0.0-dev.487+3c38bb65",
|
|
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": "1.0.0-dev.
|
|
73
|
+
"@optique/core": "1.0.0-dev.487+3c38bb65"
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
76
|
"@types/node": "^20.19.9",
|