@optique/man 1.4.0-dev.2633 → 1.4.0-dev.2636
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/cli.cjs +3 -3
- package/dist/cli.js +3 -3
- package/dist/{generator-IQLTxhd0.js → generator-CavUoyIv.js} +1 -1
- package/dist/{generator-CUCPcKy-.cjs → generator-DVBEnpDF.cjs} +1 -1
- package/dist/{generator-BK-jIonK.d.ts → generator-DgWHeZ4I.d.ts} +1 -1
- package/dist/{generator-stLqR1GX.d.cts → generator-vn382hBl.d.cts} +1 -1
- package/dist/generator.cjs +2 -2
- package/dist/generator.d.cts +2 -2
- package/dist/generator.d.ts +2 -2
- package/dist/generator.js +2 -2
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/{man-DLcciZWq.cjs → man-BJ8K8qw-.cjs} +10 -6
- package/dist/{man-B0OHE33m.d.ts → man-C--dNTRq.d.cts} +3 -2
- package/dist/{man-Yl3ZzrBK.d.cts → man-D1GouPZ0.d.ts} +3 -2
- package/dist/{man-CTCssitL.js → man-Dq6PNLlO.js} +10 -6
- package/dist/man.cjs +1 -1
- package/dist/man.d.cts +1 -1
- package/dist/man.d.ts +1 -1
- package/dist/man.js +1 -1
- package/package.json +4 -4
package/dist/cli.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
const require_man = require('./man-
|
|
2
|
+
const require_man = require('./man-BJ8K8qw-.cjs');
|
|
3
3
|
require('./roff-C8MvQ2tL.cjs');
|
|
4
|
-
const require_generator = require('./generator-
|
|
4
|
+
const require_generator = require('./generator-DVBEnpDF.cjs');
|
|
5
5
|
const __optique_core_constructs = require_man.__toESM(require("@optique/core/constructs"));
|
|
6
6
|
const __optique_core_primitives = require_man.__toESM(require("@optique/core/primitives"));
|
|
7
7
|
const __optique_core_valueparser = require_man.__toESM(require("@optique/core/valueparser"));
|
|
@@ -17,7 +17,7 @@ const node_url = require_man.__toESM(require("node:url"));
|
|
|
17
17
|
|
|
18
18
|
//#region deno.json
|
|
19
19
|
var name = "@optique/man";
|
|
20
|
-
var version = "1.4.0-dev.
|
|
20
|
+
var version = "1.4.0-dev.2636+d5357098";
|
|
21
21
|
var license = "MIT";
|
|
22
22
|
var exports$1 = {
|
|
23
23
|
".": "./src/index.ts",
|
package/dist/cli.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import "./roff-Bh9bsH6u.js";
|
|
3
|
-
import "./man-
|
|
4
|
-
import { generateManPageAsync } from "./generator-
|
|
3
|
+
import "./man-Dq6PNLlO.js";
|
|
4
|
+
import { generateManPageAsync } from "./generator-CavUoyIv.js";
|
|
5
5
|
import { object } from "@optique/core/constructs";
|
|
6
6
|
import { argument, option } from "@optique/core/primitives";
|
|
7
7
|
import { choice, string } from "@optique/core/valueparser";
|
|
@@ -17,7 +17,7 @@ import { fileURLToPath, pathToFileURL } from "node:url";
|
|
|
17
17
|
|
|
18
18
|
//#region deno.json
|
|
19
19
|
var name = "@optique/man";
|
|
20
|
-
var version = "1.4.0-dev.
|
|
20
|
+
var version = "1.4.0-dev.2636+d5357098";
|
|
21
21
|
var license = "MIT";
|
|
22
22
|
var exports = {
|
|
23
23
|
".": "./src/index.ts",
|
package/dist/generator.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
require('./man-
|
|
1
|
+
require('./man-BJ8K8qw-.cjs');
|
|
2
2
|
require('./roff-C8MvQ2tL.cjs');
|
|
3
|
-
const require_generator = require('./generator-
|
|
3
|
+
const require_generator = require('./generator-DVBEnpDF.cjs');
|
|
4
4
|
|
|
5
5
|
exports.generateManPage = require_generator.generateManPage;
|
|
6
6
|
exports.generateManPageAsync = require_generator.generateManPageAsync;
|
package/dist/generator.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import "./man-
|
|
2
|
-
import { GenerateManPageOptions, GenerateManPageProgramOptions, generateManPage, generateManPageAsync, generateManPageSync } from "./generator-
|
|
1
|
+
import "./man-C--dNTRq.cjs";
|
|
2
|
+
import { GenerateManPageOptions, GenerateManPageProgramOptions, generateManPage, generateManPageAsync, generateManPageSync } from "./generator-vn382hBl.cjs";
|
|
3
3
|
export { GenerateManPageOptions, GenerateManPageProgramOptions, generateManPage, generateManPageAsync, generateManPageSync };
|
package/dist/generator.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import "./man-
|
|
2
|
-
import { GenerateManPageOptions, GenerateManPageProgramOptions, generateManPage, generateManPageAsync, generateManPageSync } from "./generator-
|
|
1
|
+
import "./man-D1GouPZ0.js";
|
|
2
|
+
import { GenerateManPageOptions, GenerateManPageProgramOptions, generateManPage, generateManPageAsync, generateManPageSync } from "./generator-DgWHeZ4I.js";
|
|
3
3
|
export { GenerateManPageOptions, GenerateManPageProgramOptions, generateManPage, generateManPageAsync, generateManPageSync };
|
package/dist/generator.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./roff-Bh9bsH6u.js";
|
|
2
|
-
import "./man-
|
|
3
|
-
import { generateManPage, generateManPageAsync, generateManPageSync } from "./generator-
|
|
2
|
+
import "./man-Dq6PNLlO.js";
|
|
3
|
+
import { generateManPage, generateManPageAsync, generateManPageSync } from "./generator-CavUoyIv.js";
|
|
4
4
|
|
|
5
5
|
export { generateManPage, generateManPageAsync, generateManPageSync };
|
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const require_man = require('./man-
|
|
1
|
+
const require_man = require('./man-BJ8K8qw-.cjs');
|
|
2
2
|
const require_roff = require('./roff-C8MvQ2tL.cjs');
|
|
3
|
-
const require_generator = require('./generator-
|
|
3
|
+
const require_generator = require('./generator-DVBEnpDF.cjs');
|
|
4
4
|
|
|
5
5
|
exports.escapeHyphens = require_roff.escapeHyphens;
|
|
6
6
|
exports.escapeQuotedValue = require_roff.escapeQuotedValue;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ManPageOptions, formatDateForMan, formatDocPageAsMan, formatUsageTermAsRoff } from "./man-
|
|
2
|
-
import { GenerateManPageOptions, GenerateManPageProgramOptions, generateManPage, generateManPageAsync, generateManPageSync } from "./generator-
|
|
1
|
+
import { ManPageOptions, formatDateForMan, formatDocPageAsMan, formatUsageTermAsRoff } from "./man-C--dNTRq.cjs";
|
|
2
|
+
import { GenerateManPageOptions, GenerateManPageProgramOptions, generateManPage, generateManPageAsync, generateManPageSync } from "./generator-vn382hBl.cjs";
|
|
3
3
|
import { RoffFormatOptions, escapeHyphens, escapeQuotedValue, escapeRequestArg, escapeRoff, formatMessageAsRoff } from "./roff-Cpm_FJok.cjs";
|
|
4
4
|
export { type GenerateManPageOptions, type GenerateManPageProgramOptions, type ManPageOptions, type RoffFormatOptions, escapeHyphens, escapeQuotedValue, escapeRequestArg, escapeRoff, formatDateForMan, formatDocPageAsMan, formatMessageAsRoff, formatUsageTermAsRoff, generateManPage, generateManPageAsync, generateManPageSync };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ManPageOptions, formatDateForMan, formatDocPageAsMan, formatUsageTermAsRoff } from "./man-
|
|
2
|
-
import { GenerateManPageOptions, GenerateManPageProgramOptions, generateManPage, generateManPageAsync, generateManPageSync } from "./generator-
|
|
1
|
+
import { ManPageOptions, formatDateForMan, formatDocPageAsMan, formatUsageTermAsRoff } from "./man-D1GouPZ0.js";
|
|
2
|
+
import { GenerateManPageOptions, GenerateManPageProgramOptions, generateManPage, generateManPageAsync, generateManPageSync } from "./generator-DgWHeZ4I.js";
|
|
3
3
|
import { RoffFormatOptions, escapeHyphens, escapeQuotedValue, escapeRequestArg, escapeRoff, formatMessageAsRoff } from "./roff-DkJvVQ1o.js";
|
|
4
4
|
export { type GenerateManPageOptions, type GenerateManPageProgramOptions, type ManPageOptions, type RoffFormatOptions, escapeHyphens, escapeQuotedValue, escapeRequestArg, escapeRoff, formatDateForMan, formatDocPageAsMan, formatMessageAsRoff, formatUsageTermAsRoff, generateManPage, generateManPageAsync, generateManPageSync };
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { escapeHyphens, escapeQuotedValue, escapeRequestArg, escapeRoff, formatMessageAsRoff } from "./roff-Bh9bsH6u.js";
|
|
2
|
-
import { formatDateForMan, formatDocPageAsMan, formatUsageTermAsRoff } from "./man-
|
|
3
|
-
import { generateManPage, generateManPageAsync, generateManPageSync } from "./generator-
|
|
2
|
+
import { formatDateForMan, formatDocPageAsMan, formatUsageTermAsRoff } from "./man-Dq6PNLlO.js";
|
|
3
|
+
import { generateManPage, generateManPageAsync, generateManPageSync } from "./generator-CavUoyIv.js";
|
|
4
4
|
|
|
5
5
|
export { escapeHyphens, escapeQuotedValue, escapeRequestArg, escapeRoff, formatDateForMan, formatDocPageAsMan, formatMessageAsRoff, formatUsageTermAsRoff, generateManPage, generateManPageAsync, generateManPageSync };
|
|
@@ -249,7 +249,7 @@ function inferSectionTitle(entries) {
|
|
|
249
249
|
* @param section The section to format.
|
|
250
250
|
* @returns The roff-formatted section content.
|
|
251
251
|
*/
|
|
252
|
-
function formatDocSectionEntries(section, showEnvironment = false) {
|
|
252
|
+
function formatDocSectionEntries(section, showEnvironment = false, generatedEnvironment = false) {
|
|
253
253
|
const lines = [];
|
|
254
254
|
for (const entry of section.entries) {
|
|
255
255
|
const termStr = formatDocEntryTerm(entry.term);
|
|
@@ -262,18 +262,19 @@ function formatDocSectionEntries(section, showEnvironment = false) {
|
|
|
262
262
|
envVar: name
|
|
263
263
|
}])).join(", ")}]`;
|
|
264
264
|
if (entry.description) {
|
|
265
|
-
let desc = require_roff.formatMessageAsRoff(entry.description);
|
|
265
|
+
let desc = require_roff.formatMessageAsRoff(entry.description, generatedEnvironment ? { quotes: false } : {});
|
|
266
266
|
if (entry.default) desc += ` [${require_roff.formatMessageAsRoff(entry.default)}]`;
|
|
267
267
|
if (entry.choices) desc += ` (choices: ${require_roff.formatMessageAsRoff(entry.choices, { quotes: false })})`;
|
|
268
268
|
const separator = desc === "" || desc.endsWith("\n") ? "" : " ";
|
|
269
|
-
|
|
269
|
+
const body = envAnnotation === "" ? desc : desc + separator + envAnnotation;
|
|
270
|
+
lines.push(generatedEnvironment && body === "" ? "\\&" : body);
|
|
270
271
|
} else if (entry.default || entry.choices || envAnnotation !== "") {
|
|
271
272
|
const parts = [];
|
|
272
273
|
if (entry.default) parts.push(`[${require_roff.formatMessageAsRoff(entry.default)}]`);
|
|
273
274
|
if (entry.choices) parts.push(`(choices: ${require_roff.formatMessageAsRoff(entry.choices, { quotes: false })})`);
|
|
274
275
|
if (envAnnotation !== "") parts.push(envAnnotation);
|
|
275
276
|
lines.push(parts.join(" "));
|
|
276
|
-
}
|
|
277
|
+
} else if (generatedEnvironment) lines.push("\\&");
|
|
277
278
|
}
|
|
278
279
|
return lines.join("\n");
|
|
279
280
|
}
|
|
@@ -357,10 +358,13 @@ function formatDocPageAsMan(page, options) {
|
|
|
357
358
|
lines.push(`.SH "${require_roff.escapeRequestArg(title)}"`);
|
|
358
359
|
lines.push(content);
|
|
359
360
|
}
|
|
360
|
-
const automaticEnvironment = options.environment == null &&
|
|
361
|
+
const automaticEnvironment = options.environment == null && placement != null ? (0, __optique_core_doc.deriveEnvironmentSection)(page, {
|
|
362
|
+
onlyUnreferenced: placement === "inline",
|
|
363
|
+
title: typeof options.showEnvironment === "object" ? options.showEnvironment.sectionTitle : void 0
|
|
364
|
+
}) : void 0;
|
|
361
365
|
const environment = options.environment ?? automaticEnvironment;
|
|
362
366
|
if (environment != null && environment.entries.length > 0) {
|
|
363
|
-
const content = formatDocSectionEntries(environment);
|
|
367
|
+
const content = formatDocSectionEntries(environment, false, automaticEnvironment != null);
|
|
364
368
|
if (content !== "") {
|
|
365
369
|
const title = automaticEnvironment == null ? "ENVIRONMENT" : automaticEnvironment.title?.toUpperCase() ?? "ENVIRONMENT";
|
|
366
370
|
lines.push(title === "ENVIRONMENT" ? ".SH ENVIRONMENT" : `.SH "${require_roff.escapeRequestArg(title)}"`);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Message } from "@optique/core/message";
|
|
2
1
|
import { DocPage, DocSection, ShowEnvironmentOptions } from "@optique/core/doc";
|
|
2
|
+
import { Message } from "@optique/core/message";
|
|
3
3
|
import { UsageTerm } from "@optique/core/usage";
|
|
4
4
|
|
|
5
5
|
//#region src/man.d.ts
|
|
@@ -72,7 +72,8 @@ interface ManPageOptions {
|
|
|
72
72
|
readonly environment?: DocSection;
|
|
73
73
|
/**
|
|
74
74
|
* Displays declared environment bindings. `true` selects inline annotations;
|
|
75
|
-
* an object can select a generated section or both.
|
|
75
|
+
* an object can select a generated section or both. Names without visible
|
|
76
|
+
* CLI references get a fallback section in inline mode. Defaults to `false`.
|
|
76
77
|
* A supplied `environment` section overrides the generated section, including
|
|
77
78
|
* an empty section. Inline annotations are independent of that override.
|
|
78
79
|
* `sectionTitle` only affects generated sections and is uppercased.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DocPage, DocSection, ShowEnvironmentOptions } from "@optique/core/doc";
|
|
2
1
|
import { Message } from "@optique/core/message";
|
|
2
|
+
import { DocPage, DocSection, ShowEnvironmentOptions } from "@optique/core/doc";
|
|
3
3
|
import { UsageTerm } from "@optique/core/usage";
|
|
4
4
|
|
|
5
5
|
//#region src/man.d.ts
|
|
@@ -72,7 +72,8 @@ interface ManPageOptions {
|
|
|
72
72
|
readonly environment?: DocSection;
|
|
73
73
|
/**
|
|
74
74
|
* Displays declared environment bindings. `true` selects inline annotations;
|
|
75
|
-
* an object can select a generated section or both.
|
|
75
|
+
* an object can select a generated section or both. Names without visible
|
|
76
|
+
* CLI references get a fallback section in inline mode. Defaults to `false`.
|
|
76
77
|
* A supplied `environment` section overrides the generated section, including
|
|
77
78
|
* an empty section. Inline annotations are independent of that override.
|
|
78
79
|
* `sectionTitle` only affects generated sections and is uppercased.
|
|
@@ -226,7 +226,7 @@ function inferSectionTitle(entries) {
|
|
|
226
226
|
* @param section The section to format.
|
|
227
227
|
* @returns The roff-formatted section content.
|
|
228
228
|
*/
|
|
229
|
-
function formatDocSectionEntries(section, showEnvironment = false) {
|
|
229
|
+
function formatDocSectionEntries(section, showEnvironment = false, generatedEnvironment = false) {
|
|
230
230
|
const lines = [];
|
|
231
231
|
for (const entry of section.entries) {
|
|
232
232
|
const termStr = formatDocEntryTerm(entry.term);
|
|
@@ -239,18 +239,19 @@ function formatDocSectionEntries(section, showEnvironment = false) {
|
|
|
239
239
|
envVar: name
|
|
240
240
|
}])).join(", ")}]`;
|
|
241
241
|
if (entry.description) {
|
|
242
|
-
let desc = formatMessageAsRoff(entry.description);
|
|
242
|
+
let desc = formatMessageAsRoff(entry.description, generatedEnvironment ? { quotes: false } : {});
|
|
243
243
|
if (entry.default) desc += ` [${formatMessageAsRoff(entry.default)}]`;
|
|
244
244
|
if (entry.choices) desc += ` (choices: ${formatMessageAsRoff(entry.choices, { quotes: false })})`;
|
|
245
245
|
const separator = desc === "" || desc.endsWith("\n") ? "" : " ";
|
|
246
|
-
|
|
246
|
+
const body = envAnnotation === "" ? desc : desc + separator + envAnnotation;
|
|
247
|
+
lines.push(generatedEnvironment && body === "" ? "\\&" : body);
|
|
247
248
|
} else if (entry.default || entry.choices || envAnnotation !== "") {
|
|
248
249
|
const parts = [];
|
|
249
250
|
if (entry.default) parts.push(`[${formatMessageAsRoff(entry.default)}]`);
|
|
250
251
|
if (entry.choices) parts.push(`(choices: ${formatMessageAsRoff(entry.choices, { quotes: false })})`);
|
|
251
252
|
if (envAnnotation !== "") parts.push(envAnnotation);
|
|
252
253
|
lines.push(parts.join(" "));
|
|
253
|
-
}
|
|
254
|
+
} else if (generatedEnvironment) lines.push("\\&");
|
|
254
255
|
}
|
|
255
256
|
return lines.join("\n");
|
|
256
257
|
}
|
|
@@ -334,10 +335,13 @@ function formatDocPageAsMan(page, options) {
|
|
|
334
335
|
lines.push(`.SH "${escapeRequestArg(title)}"`);
|
|
335
336
|
lines.push(content);
|
|
336
337
|
}
|
|
337
|
-
const automaticEnvironment = options.environment == null &&
|
|
338
|
+
const automaticEnvironment = options.environment == null && placement != null ? deriveEnvironmentSection(page, {
|
|
339
|
+
onlyUnreferenced: placement === "inline",
|
|
340
|
+
title: typeof options.showEnvironment === "object" ? options.showEnvironment.sectionTitle : void 0
|
|
341
|
+
}) : void 0;
|
|
338
342
|
const environment = options.environment ?? automaticEnvironment;
|
|
339
343
|
if (environment != null && environment.entries.length > 0) {
|
|
340
|
-
const content = formatDocSectionEntries(environment);
|
|
344
|
+
const content = formatDocSectionEntries(environment, false, automaticEnvironment != null);
|
|
341
345
|
if (content !== "") {
|
|
342
346
|
const title = automaticEnvironment == null ? "ENVIRONMENT" : automaticEnvironment.title?.toUpperCase() ?? "ENVIRONMENT";
|
|
343
347
|
lines.push(title === "ENVIRONMENT" ? ".SH ENVIRONMENT" : `.SH "${escapeRequestArg(title)}"`);
|
package/dist/man.cjs
CHANGED
package/dist/man.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ManPageOptions, ManPageSection, formatDateForMan, formatDocPageAsMan, formatUsageTermAsRoff } from "./man-
|
|
1
|
+
import { ManPageOptions, ManPageSection, formatDateForMan, formatDocPageAsMan, formatUsageTermAsRoff } from "./man-C--dNTRq.cjs";
|
|
2
2
|
export { ManPageOptions, ManPageSection, formatDateForMan, formatDocPageAsMan, formatUsageTermAsRoff };
|
package/dist/man.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ManPageOptions, ManPageSection, formatDateForMan, formatDocPageAsMan, formatUsageTermAsRoff } from "./man-
|
|
1
|
+
import { ManPageOptions, ManPageSection, formatDateForMan, formatDocPageAsMan, formatUsageTermAsRoff } from "./man-D1GouPZ0.js";
|
|
2
2
|
export { ManPageOptions, ManPageSection, formatDateForMan, formatDocPageAsMan, formatUsageTermAsRoff };
|
package/dist/man.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import "./roff-Bh9bsH6u.js";
|
|
2
|
-
import { formatDateForMan, formatDocPageAsMan, formatUsageTermAsRoff } from "./man-
|
|
2
|
+
import { formatDateForMan, formatDocPageAsMan, formatUsageTermAsRoff } from "./man-Dq6PNLlO.js";
|
|
3
3
|
|
|
4
4
|
export { formatDateForMan, formatDocPageAsMan, formatUsageTermAsRoff };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@optique/man",
|
|
3
|
-
"version": "1.4.0-dev.
|
|
3
|
+
"version": "1.4.0-dev.2636",
|
|
4
4
|
"description": "Man page generator for Optique CLI parsers",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"CLI",
|
|
@@ -90,11 +90,11 @@
|
|
|
90
90
|
"optique-man": "./dist/cli.js"
|
|
91
91
|
},
|
|
92
92
|
"dependencies": {
|
|
93
|
-
"@optique/core": "1.4.0-dev.
|
|
94
|
-
"@optique/run": "1.4.0-dev.
|
|
93
|
+
"@optique/core": "1.4.0-dev.2636+d5357098",
|
|
94
|
+
"@optique/run": "1.4.0-dev.2636+d5357098"
|
|
95
95
|
},
|
|
96
96
|
"devDependencies": {
|
|
97
|
-
"@optique/testing": "1.4.0-dev.
|
|
97
|
+
"@optique/testing": "1.4.0-dev.2636+d5357098",
|
|
98
98
|
"@types/node": "^24.0.0",
|
|
99
99
|
"tsdown": "^0.13.0",
|
|
100
100
|
"tsx": "^4.21.0",
|