@clerc/plugin-help 0.12.3 → 0.12.5
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/index.js +8 -8
- package/dist/index.mjs +8 -8
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -88,20 +88,20 @@ const showHelp = (ctx, notes, examples) => {
|
|
|
88
88
|
if (ctx.isSingleCommand) {
|
|
89
89
|
sections.push({
|
|
90
90
|
title: "Usage:",
|
|
91
|
-
body: [`$ ${cli._name} [
|
|
91
|
+
body: [`$ ${cli._name} [flags]`]
|
|
92
92
|
});
|
|
93
93
|
} else {
|
|
94
94
|
sections.push({
|
|
95
95
|
title: "Usage:",
|
|
96
|
-
body: [`$ ${cli._name} [command] [
|
|
96
|
+
body: [`$ ${cli._name} [command] [flags]`]
|
|
97
97
|
});
|
|
98
98
|
}
|
|
99
99
|
if (!ctx.isSingleCommand) {
|
|
100
100
|
sections.push({
|
|
101
101
|
title: "Commands:",
|
|
102
|
-
body: Object.values(cli._commands).map((command) => {
|
|
103
|
-
return
|
|
104
|
-
})
|
|
102
|
+
body: table(...Object.values(cli._commands).map((command) => {
|
|
103
|
+
return [pc.cyan(command.name), DELIMITER, command.description];
|
|
104
|
+
})).toString().split("\n")
|
|
105
105
|
});
|
|
106
106
|
}
|
|
107
107
|
if (notes) {
|
|
@@ -113,7 +113,7 @@ const showHelp = (ctx, notes, examples) => {
|
|
|
113
113
|
if (examples) {
|
|
114
114
|
generateExamples(sections, examples);
|
|
115
115
|
}
|
|
116
|
-
|
|
116
|
+
process.stdout.write(render(sections));
|
|
117
117
|
};
|
|
118
118
|
const showSubcommandHelp = (ctx, command) => {
|
|
119
119
|
var _a;
|
|
@@ -127,7 +127,7 @@ const showSubcommandHelp = (ctx, command) => {
|
|
|
127
127
|
const parameters = ((_a = subcommand.parameters) == null ? void 0 : _a.join(", ")) || "";
|
|
128
128
|
sections.push({
|
|
129
129
|
title: "Usage:",
|
|
130
|
-
body: [`$ ${cli._name} ${subcommand.name}${parameters ? ` ${parameters}` : ""} [
|
|
130
|
+
body: [`$ ${cli._name} ${subcommand.name}${parameters ? ` ${parameters}` : ""} [flags]`]
|
|
131
131
|
});
|
|
132
132
|
if (subcommand.flags) {
|
|
133
133
|
sections.push({
|
|
@@ -158,7 +158,7 @@ const showSubcommandHelp = (ctx, command) => {
|
|
|
158
158
|
if (subcommand.examples) {
|
|
159
159
|
generateExamples(sections, subcommand.examples);
|
|
160
160
|
}
|
|
161
|
-
|
|
161
|
+
process.stdout.write(render(sections));
|
|
162
162
|
};
|
|
163
163
|
const helpPlugin = ({
|
|
164
164
|
command = true,
|
package/dist/index.mjs
CHANGED
|
@@ -88,20 +88,20 @@ const showHelp = (ctx, notes, examples) => {
|
|
|
88
88
|
if (ctx.isSingleCommand) {
|
|
89
89
|
sections.push({
|
|
90
90
|
title: "Usage:",
|
|
91
|
-
body: [`$ ${cli._name} [
|
|
91
|
+
body: [`$ ${cli._name} [flags]`]
|
|
92
92
|
});
|
|
93
93
|
} else {
|
|
94
94
|
sections.push({
|
|
95
95
|
title: "Usage:",
|
|
96
|
-
body: [`$ ${cli._name} [command] [
|
|
96
|
+
body: [`$ ${cli._name} [command] [flags]`]
|
|
97
97
|
});
|
|
98
98
|
}
|
|
99
99
|
if (!ctx.isSingleCommand) {
|
|
100
100
|
sections.push({
|
|
101
101
|
title: "Commands:",
|
|
102
|
-
body: Object.values(cli._commands).map((command) => {
|
|
103
|
-
return
|
|
104
|
-
})
|
|
102
|
+
body: table(...Object.values(cli._commands).map((command) => {
|
|
103
|
+
return [pc.cyan(command.name), DELIMITER, command.description];
|
|
104
|
+
})).toString().split("\n")
|
|
105
105
|
});
|
|
106
106
|
}
|
|
107
107
|
if (notes) {
|
|
@@ -113,7 +113,7 @@ const showHelp = (ctx, notes, examples) => {
|
|
|
113
113
|
if (examples) {
|
|
114
114
|
generateExamples(sections, examples);
|
|
115
115
|
}
|
|
116
|
-
|
|
116
|
+
process.stdout.write(render(sections));
|
|
117
117
|
};
|
|
118
118
|
const showSubcommandHelp = (ctx, command) => {
|
|
119
119
|
var _a;
|
|
@@ -127,7 +127,7 @@ const showSubcommandHelp = (ctx, command) => {
|
|
|
127
127
|
const parameters = ((_a = subcommand.parameters) == null ? void 0 : _a.join(", ")) || "";
|
|
128
128
|
sections.push({
|
|
129
129
|
title: "Usage:",
|
|
130
|
-
body: [`$ ${cli._name} ${subcommand.name}${parameters ? ` ${parameters}` : ""} [
|
|
130
|
+
body: [`$ ${cli._name} ${subcommand.name}${parameters ? ` ${parameters}` : ""} [flags]`]
|
|
131
131
|
});
|
|
132
132
|
if (subcommand.flags) {
|
|
133
133
|
sections.push({
|
|
@@ -158,7 +158,7 @@ const showSubcommandHelp = (ctx, command) => {
|
|
|
158
158
|
if (subcommand.examples) {
|
|
159
159
|
generateExamples(sections, subcommand.examples);
|
|
160
160
|
}
|
|
161
|
-
|
|
161
|
+
process.stdout.write(render(sections));
|
|
162
162
|
};
|
|
163
163
|
const helpPlugin = ({
|
|
164
164
|
command = true,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@clerc/plugin-help",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.5",
|
|
4
4
|
"author": "Ray <nn_201312@163.com> (https://github.com/so1ve)",
|
|
5
5
|
"description": "Clerc plugin help",
|
|
6
6
|
"keywords": [
|
|
@@ -51,12 +51,12 @@
|
|
|
51
51
|
"@clerc/core": "*"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"
|
|
55
|
-
"@clerc/
|
|
56
|
-
"
|
|
54
|
+
"picocolors": "^1.0.0",
|
|
55
|
+
"@clerc/toolkit": "0.12.5",
|
|
56
|
+
"@clerc/utils": "0.12.5"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
|
-
"@clerc/core": "0.12.
|
|
59
|
+
"@clerc/core": "0.12.5"
|
|
60
60
|
},
|
|
61
61
|
"scripts": {
|
|
62
62
|
"build": "puild",
|