@optique/core 1.0.16-dev.2947 → 1.0.16-dev.2975
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/constructs.cjs +52 -18
- package/dist/constructs.js +53 -19
- package/dist/internal/command-doc-metadata.cjs +32 -4
- package/dist/internal/command-doc-metadata.js +30 -4
- package/dist/internal/command-usage.cjs +52 -0
- package/dist/internal/command-usage.js +47 -0
- package/dist/internal/parser.cjs +111 -7
- package/dist/internal/parser.js +111 -7
- package/dist/message.cjs +4 -3
- package/dist/message.js +4 -3
- package/dist/modifiers.cjs +15 -1
- package/dist/modifiers.js +16 -2
- package/dist/primitives.cjs +7 -4
- package/dist/primitives.js +8 -5
- package/dist/usage.cjs +7 -6
- package/dist/usage.js +7 -6
- package/package.json +1 -1
package/dist/usage.cjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
const require_displaywidth = require('./displaywidth.cjs');
|
|
2
|
+
const require_command_usage = require('./internal/command-usage.cjs');
|
|
2
3
|
const require_validate = require('./validate.cjs');
|
|
3
4
|
|
|
4
5
|
//#region src/usage.ts
|
|
@@ -301,11 +302,11 @@ function normalizeUsageTerm(term) {
|
|
|
301
302
|
names: [...term.names]
|
|
302
303
|
};
|
|
303
304
|
else if (term.type === "command") {
|
|
304
|
-
if (term.usageLine == null || typeof term.usageLine === "function") return { ...term };
|
|
305
|
-
return {
|
|
305
|
+
if (term.usageLine == null || typeof term.usageLine === "function") return require_command_usage.copyCommandUsageId(term, { ...term });
|
|
306
|
+
return require_command_usage.copyCommandUsageId(term, {
|
|
306
307
|
...term,
|
|
307
308
|
usageLine: cloneUsage(term.usageLine)
|
|
308
|
-
};
|
|
309
|
+
});
|
|
309
310
|
}
|
|
310
311
|
return { ...term };
|
|
311
312
|
}
|
|
@@ -350,11 +351,11 @@ function cloneUsageTerm(term) {
|
|
|
350
351
|
names: [...term.names]
|
|
351
352
|
};
|
|
352
353
|
case "command": {
|
|
353
|
-
if (term.usageLine == null || typeof term.usageLine === "function") return { ...term };
|
|
354
|
-
return {
|
|
354
|
+
if (term.usageLine == null || typeof term.usageLine === "function") return require_command_usage.copyCommandUsageId(term, { ...term });
|
|
355
|
+
return require_command_usage.copyCommandUsageId(term, {
|
|
355
356
|
...term,
|
|
356
357
|
usageLine: term.usageLine.map(cloneUsageTerm)
|
|
357
|
-
};
|
|
358
|
+
});
|
|
358
359
|
}
|
|
359
360
|
case "optional": return {
|
|
360
361
|
type: "optional",
|
package/dist/usage.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { getDisplayWidth } from "./displaywidth.js";
|
|
2
|
+
import { copyCommandUsageId } from "./internal/command-usage.js";
|
|
2
3
|
import { validateProgramName } from "./validate.js";
|
|
3
4
|
|
|
4
5
|
//#region src/usage.ts
|
|
@@ -301,11 +302,11 @@ function normalizeUsageTerm(term) {
|
|
|
301
302
|
names: [...term.names]
|
|
302
303
|
};
|
|
303
304
|
else if (term.type === "command") {
|
|
304
|
-
if (term.usageLine == null || typeof term.usageLine === "function") return { ...term };
|
|
305
|
-
return {
|
|
305
|
+
if (term.usageLine == null || typeof term.usageLine === "function") return copyCommandUsageId(term, { ...term });
|
|
306
|
+
return copyCommandUsageId(term, {
|
|
306
307
|
...term,
|
|
307
308
|
usageLine: cloneUsage(term.usageLine)
|
|
308
|
-
};
|
|
309
|
+
});
|
|
309
310
|
}
|
|
310
311
|
return { ...term };
|
|
311
312
|
}
|
|
@@ -350,11 +351,11 @@ function cloneUsageTerm(term) {
|
|
|
350
351
|
names: [...term.names]
|
|
351
352
|
};
|
|
352
353
|
case "command": {
|
|
353
|
-
if (term.usageLine == null || typeof term.usageLine === "function") return { ...term };
|
|
354
|
-
return {
|
|
354
|
+
if (term.usageLine == null || typeof term.usageLine === "function") return copyCommandUsageId(term, { ...term });
|
|
355
|
+
return copyCommandUsageId(term, {
|
|
355
356
|
...term,
|
|
356
357
|
usageLine: term.usageLine.map(cloneUsageTerm)
|
|
357
|
-
};
|
|
358
|
+
});
|
|
358
359
|
}
|
|
359
360
|
case "optional": return {
|
|
360
361
|
type: "optional",
|