@virmator/help 14.30.3 → 14.30.4
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/help-message.js +33 -25
- package/package.json +3 -3
package/dist/help-message.js
CHANGED
|
@@ -111,22 +111,26 @@ function flagToHelpString({ flagName, description, format, }) {
|
|
|
111
111
|
}
|
|
112
112
|
function flagsToHelpString(flags, format) {
|
|
113
113
|
return getObjectTypedEntries(flags)
|
|
114
|
-
.map(([flagName, entry,]) =>
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
114
|
+
.map(([flagName, entry,]) => {
|
|
115
|
+
return flagToHelpString({
|
|
116
|
+
flagName,
|
|
117
|
+
description: entry.doc,
|
|
118
|
+
format,
|
|
119
|
+
});
|
|
120
|
+
})
|
|
119
121
|
.join('\n');
|
|
120
122
|
}
|
|
121
123
|
function commandToHelpString({ commandName, command, format, indentCount, }) {
|
|
122
124
|
const title = `${indent(indentCount, format)}${format.bullet}${bold(commandName, format)}${format.reset}`;
|
|
123
125
|
const description = commandDocToString(command, format, indentCount);
|
|
124
|
-
const subCommands = getObjectTypedEntries(command.subCommands || {}).map(([subCommandName, subCommand,]) =>
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
126
|
+
const subCommands = getObjectTypedEntries(command.subCommands || {}).map(([subCommandName, subCommand,]) => {
|
|
127
|
+
return commandToHelpString({
|
|
128
|
+
commandName: subCommandName,
|
|
129
|
+
command: subCommand,
|
|
130
|
+
format,
|
|
131
|
+
indentCount: indentCount + 2,
|
|
132
|
+
});
|
|
133
|
+
});
|
|
130
134
|
const subCommandsBlock = subCommands.length
|
|
131
135
|
? `\n${indent(indentCount + 1, format)}${format.bullet}Sub Commands\n\n${subCommands.join('\n\n')}`
|
|
132
136
|
: '';
|
|
@@ -142,20 +146,24 @@ function docEntryToString({ entry, indentCount, useBullets, format, }) {
|
|
|
142
146
|
return `${indent(indentCount + 1, format)}${useBullets ? format.bullet : ''}${title}${content}`;
|
|
143
147
|
}
|
|
144
148
|
function commandDocToString(command, format, indentCount) {
|
|
145
|
-
const sections = command.doc.sections.map((section) =>
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
149
|
+
const sections = command.doc.sections.map((section) => {
|
|
150
|
+
return docEntryToString({
|
|
151
|
+
entry: {
|
|
152
|
+
content: section,
|
|
153
|
+
},
|
|
154
|
+
indentCount,
|
|
155
|
+
useBullets: false,
|
|
156
|
+
format,
|
|
157
|
+
});
|
|
158
|
+
});
|
|
159
|
+
const examples = command.doc.examples.map((example) => {
|
|
160
|
+
return docEntryToString({
|
|
161
|
+
entry: example,
|
|
162
|
+
indentCount: indentCount + 1,
|
|
163
|
+
useBullets: true,
|
|
164
|
+
format,
|
|
165
|
+
});
|
|
166
|
+
});
|
|
159
167
|
const exampleBlock = examples.length
|
|
160
168
|
? `${indent(indentCount + 1, format)}${format.bullet}Examples\n${examples.join('\n')}`
|
|
161
169
|
: '';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@virmator/help",
|
|
3
|
-
"version": "14.30.
|
|
3
|
+
"version": "14.30.4",
|
|
4
4
|
"description": "Default help plugin for virmator.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"virmator",
|
|
@@ -35,11 +35,11 @@
|
|
|
35
35
|
"@augment-vir/assert": "^32.2.1",
|
|
36
36
|
"@augment-vir/common": "^32.2.1",
|
|
37
37
|
"@augment-vir/node": "^32.2.1",
|
|
38
|
-
"@virmator/core": "^14.30.
|
|
38
|
+
"@virmator/core": "^14.30.4"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@augment-vir/test": "^32.2.1",
|
|
42
|
-
"@types/node": "^26.1.
|
|
42
|
+
"@types/node": "^26.1.2",
|
|
43
43
|
"c8": "^12.0.0",
|
|
44
44
|
"istanbul-smart-text-reporter": "^1.1.5"
|
|
45
45
|
},
|