@optique/man 0.10.0-dev.377 → 0.10.0-dev.381
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 +6 -6
- package/dist/cli.js +6 -6
- package/dist/{generator-CogCcLy4.js → generator-CCa36YC2.js} +1 -1
- package/dist/{generator-Ce1Cp92I.cjs → generator-zoVk04OH.cjs} +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.js +2 -2
- package/dist/{man-BzwYMoSb.cjs → man-DGnow1Jr.cjs} +12 -12
- package/dist/{man-x67FIIPq.js → man-Leuf7kOn.js} +12 -12
- package/dist/man.cjs +1 -1
- package/dist/man.js +1 -1
- package/package.json +3 -3
package/dist/cli.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
const require_generator = require('./generator-
|
|
2
|
+
const require_generator = require('./generator-zoVk04OH.cjs');
|
|
3
3
|
require('./roff-EpcecLXU.cjs');
|
|
4
|
-
require('./man-
|
|
4
|
+
require('./man-DGnow1Jr.cjs');
|
|
5
5
|
const __optique_core_constructs = require_generator.__toESM(require("@optique/core/constructs"));
|
|
6
6
|
const __optique_core_primitives = require_generator.__toESM(require("@optique/core/primitives"));
|
|
7
7
|
const __optique_core_valueparser = require_generator.__toESM(require("@optique/core/valueparser"));
|
|
@@ -17,7 +17,7 @@ const node_url = require_generator.__toESM(require("node:url"));
|
|
|
17
17
|
|
|
18
18
|
//#region deno.json
|
|
19
19
|
var name = "@optique/man";
|
|
20
|
-
var version = "0.10.0-dev.
|
|
20
|
+
var version = "0.10.0-dev.381+8e08d6d0";
|
|
21
21
|
var license = "MIT";
|
|
22
22
|
var exports$1 = {
|
|
23
23
|
".": "./src/index.ts",
|
|
@@ -224,9 +224,9 @@ async function importModule(filePath) {
|
|
|
224
224
|
const absolutePath = (0, node_path.resolve)(filePath);
|
|
225
225
|
if (!(0, node_fs.existsSync)(absolutePath)) fileNotFoundError(filePath);
|
|
226
226
|
const isTypeScript = /\.[mc]?ts$/.test(filePath);
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
if (isTypeScript && !nodeSupportsNativeTypeScript()) try {
|
|
227
|
+
const isDeno = typeof globalThis.Deno !== "undefined";
|
|
228
|
+
const isBun = typeof globalThis.Bun !== "undefined";
|
|
229
|
+
if (!isDeno && !isBun && isTypeScript && !nodeSupportsNativeTypeScript()) try {
|
|
230
230
|
const tsx = await import("tsx/esm/api");
|
|
231
231
|
tsx.register();
|
|
232
232
|
} catch {
|
package/dist/cli.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import "./roff-C_MiRXVS.js";
|
|
3
|
-
import "./man-
|
|
4
|
-
import { generateManPageAsync } from "./generator-
|
|
3
|
+
import "./man-Leuf7kOn.js";
|
|
4
|
+
import { generateManPageAsync } from "./generator-CCa36YC2.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 = "0.10.0-dev.
|
|
20
|
+
var version = "0.10.0-dev.381+8e08d6d0";
|
|
21
21
|
var license = "MIT";
|
|
22
22
|
var exports = {
|
|
23
23
|
".": "./src/index.ts",
|
|
@@ -224,9 +224,9 @@ async function importModule(filePath) {
|
|
|
224
224
|
const absolutePath = resolve(filePath);
|
|
225
225
|
if (!existsSync(absolutePath)) fileNotFoundError(filePath);
|
|
226
226
|
const isTypeScript = /\.[mc]?ts$/.test(filePath);
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
if (isTypeScript && !nodeSupportsNativeTypeScript()) try {
|
|
227
|
+
const isDeno = typeof globalThis.Deno !== "undefined";
|
|
228
|
+
const isBun = typeof globalThis.Bun !== "undefined";
|
|
229
|
+
if (!isDeno && !isBun && isTypeScript && !nodeSupportsNativeTypeScript()) try {
|
|
230
230
|
const tsx = await import("tsx/esm/api");
|
|
231
231
|
tsx.register();
|
|
232
232
|
} catch {
|
|
@@ -21,7 +21,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
21
21
|
}) : target, mod));
|
|
22
22
|
|
|
23
23
|
//#endregion
|
|
24
|
-
const require_man = require('./man-
|
|
24
|
+
const require_man = require('./man-DGnow1Jr.cjs');
|
|
25
25
|
const __optique_core_parser = __toESM(require("@optique/core/parser"));
|
|
26
26
|
|
|
27
27
|
//#region src/generator.ts
|
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const require_generator = require('./generator-
|
|
1
|
+
const require_generator = require('./generator-zoVk04OH.cjs');
|
|
2
2
|
const require_roff = require('./roff-EpcecLXU.cjs');
|
|
3
|
-
const require_man = require('./man-
|
|
3
|
+
const require_man = require('./man-DGnow1Jr.cjs');
|
|
4
4
|
|
|
5
5
|
exports.escapeHyphens = require_roff.escapeHyphens;
|
|
6
6
|
exports.escapeRoff = require_roff.escapeRoff;
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { escapeHyphens, escapeRoff, formatMessageAsRoff } from "./roff-C_MiRXVS.js";
|
|
2
|
-
import { formatDateForMan, formatDocPageAsMan, formatUsageTermAsRoff } from "./man-
|
|
3
|
-
import { generateManPage, generateManPageAsync, generateManPageSync } from "./generator-
|
|
2
|
+
import { formatDateForMan, formatDocPageAsMan, formatUsageTermAsRoff } from "./man-Leuf7kOn.js";
|
|
3
|
+
import { generateManPage, generateManPageAsync, generateManPageSync } from "./generator-CCa36YC2.js";
|
|
4
4
|
|
|
5
5
|
export { escapeHyphens, escapeRoff, formatDateForMan, formatDocPageAsMan, formatMessageAsRoff, formatUsageTermAsRoff, generateManPage, generateManPageAsync, generateManPageSync };
|
|
@@ -27,6 +27,9 @@ function formatDateForMan(date) {
|
|
|
27
27
|
];
|
|
28
28
|
return `${months[date.getMonth()]} ${date.getFullYear()}`;
|
|
29
29
|
}
|
|
30
|
+
function escapeThField(value) {
|
|
31
|
+
return value.replace(/\\/g, "\\\\").replace(/"/g, "\\\"");
|
|
32
|
+
}
|
|
30
33
|
/**
|
|
31
34
|
* Formats a single {@link UsageTerm} as roff markup for the SYNOPSIS section.
|
|
32
35
|
*
|
|
@@ -143,18 +146,15 @@ function formatDocSectionEntries(section) {
|
|
|
143
146
|
*/
|
|
144
147
|
function formatDocPageAsMan(page, options) {
|
|
145
148
|
const lines = [];
|
|
146
|
-
const thParts = [options.name.toUpperCase(), options.section.toString()];
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
}
|
|
153
|
-
if (
|
|
154
|
-
|
|
155
|
-
if (options.version == null) thParts.push("\"\"");
|
|
156
|
-
thParts.push(`"${options.manual}"`);
|
|
157
|
-
}
|
|
149
|
+
const thParts = [escapeThField(options.name.toUpperCase()), options.section.toString()];
|
|
150
|
+
const hasDate = options.date != null;
|
|
151
|
+
const hasVersion = options.version != null;
|
|
152
|
+
const hasManual = options.manual != null;
|
|
153
|
+
if (hasDate) thParts.push(`"${escapeThField(formatDateForMan(options.date))}"`);
|
|
154
|
+
else if (hasVersion || hasManual) thParts.push("\"\"");
|
|
155
|
+
if (hasVersion) thParts.push(`"${escapeThField(`${options.name} ${options.version}`)}"`);
|
|
156
|
+
else if (hasManual) thParts.push("\"\"");
|
|
157
|
+
if (hasManual) thParts.push(`"${escapeThField(options.manual)}"`);
|
|
158
158
|
lines.push(`.TH ${thParts.join(" ")}`);
|
|
159
159
|
lines.push(".SH NAME");
|
|
160
160
|
if (page.brief) lines.push(`${options.name} \\- ${require_roff.formatMessageAsRoff(page.brief)}`);
|
|
@@ -27,6 +27,9 @@ function formatDateForMan(date) {
|
|
|
27
27
|
];
|
|
28
28
|
return `${months[date.getMonth()]} ${date.getFullYear()}`;
|
|
29
29
|
}
|
|
30
|
+
function escapeThField(value) {
|
|
31
|
+
return value.replace(/\\/g, "\\\\").replace(/"/g, "\\\"");
|
|
32
|
+
}
|
|
30
33
|
/**
|
|
31
34
|
* Formats a single {@link UsageTerm} as roff markup for the SYNOPSIS section.
|
|
32
35
|
*
|
|
@@ -143,18 +146,15 @@ function formatDocSectionEntries(section) {
|
|
|
143
146
|
*/
|
|
144
147
|
function formatDocPageAsMan(page, options) {
|
|
145
148
|
const lines = [];
|
|
146
|
-
const thParts = [options.name.toUpperCase(), options.section.toString()];
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
}
|
|
153
|
-
if (
|
|
154
|
-
|
|
155
|
-
if (options.version == null) thParts.push("\"\"");
|
|
156
|
-
thParts.push(`"${options.manual}"`);
|
|
157
|
-
}
|
|
149
|
+
const thParts = [escapeThField(options.name.toUpperCase()), options.section.toString()];
|
|
150
|
+
const hasDate = options.date != null;
|
|
151
|
+
const hasVersion = options.version != null;
|
|
152
|
+
const hasManual = options.manual != null;
|
|
153
|
+
if (hasDate) thParts.push(`"${escapeThField(formatDateForMan(options.date))}"`);
|
|
154
|
+
else if (hasVersion || hasManual) thParts.push("\"\"");
|
|
155
|
+
if (hasVersion) thParts.push(`"${escapeThField(`${options.name} ${options.version}`)}"`);
|
|
156
|
+
else if (hasManual) thParts.push("\"\"");
|
|
157
|
+
if (hasManual) thParts.push(`"${escapeThField(options.manual)}"`);
|
|
158
158
|
lines.push(`.TH ${thParts.join(" ")}`);
|
|
159
159
|
lines.push(".SH NAME");
|
|
160
160
|
if (page.brief) lines.push(`${options.name} \\- ${formatMessageAsRoff(page.brief)}`);
|
package/dist/man.cjs
CHANGED
package/dist/man.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import "./roff-C_MiRXVS.js";
|
|
2
|
-
import { formatDateForMan, formatDocPageAsMan, formatUsageTermAsRoff } from "./man-
|
|
2
|
+
import { formatDateForMan, formatDocPageAsMan, formatUsageTermAsRoff } from "./man-Leuf7kOn.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": "0.10.0-dev.
|
|
3
|
+
"version": "0.10.0-dev.381+8e08d6d0",
|
|
4
4
|
"description": "Man page generator for Optique CLI parsers",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"CLI",
|
|
@@ -84,8 +84,8 @@
|
|
|
84
84
|
"optique-man": "./dist/cli.js"
|
|
85
85
|
},
|
|
86
86
|
"dependencies": {
|
|
87
|
-
"@optique/
|
|
88
|
-
"@optique/
|
|
87
|
+
"@optique/core": "0.10.0-dev.381+8e08d6d0",
|
|
88
|
+
"@optique/run": "0.10.0-dev.381+8e08d6d0"
|
|
89
89
|
},
|
|
90
90
|
"devDependencies": {
|
|
91
91
|
"@types/node": "^20.19.9",
|