@clerc/plugin-help 0.12.2 → 0.12.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/index.js CHANGED
@@ -113,7 +113,7 @@ const showHelp = (ctx, notes, examples) => {
113
113
  if (examples) {
114
114
  generateExamples(sections, examples);
115
115
  }
116
- console.log(render(sections));
116
+ process.stdout.write(render(sections));
117
117
  };
118
118
  const showSubcommandHelp = (ctx, command) => {
119
119
  var _a;
@@ -158,7 +158,7 @@ const showSubcommandHelp = (ctx, command) => {
158
158
  if (subcommand.examples) {
159
159
  generateExamples(sections, subcommand.examples);
160
160
  }
161
- console.log(render(sections));
161
+ process.stdout.write(render(sections));
162
162
  };
163
163
  const helpPlugin = ({
164
164
  command = true,
@@ -189,13 +189,15 @@ const helpPlugin = ({
189
189
  }
190
190
  });
191
191
  }
192
- cli.inspector((ctx) => {
192
+ cli.inspector((ctx, next) => {
193
193
  if (ctx.raw.mergedFlags.h || ctx.raw.mergedFlags.help) {
194
194
  if (ctx.raw._.length) {
195
195
  showSubcommandHelp(ctx, ctx.raw._);
196
196
  } else {
197
197
  showHelp(ctx, notes, examples);
198
198
  }
199
+ } else {
200
+ next();
199
201
  }
200
202
  });
201
203
  return cli;
package/dist/index.mjs CHANGED
@@ -113,7 +113,7 @@ const showHelp = (ctx, notes, examples) => {
113
113
  if (examples) {
114
114
  generateExamples(sections, examples);
115
115
  }
116
- console.log(render(sections));
116
+ process.stdout.write(render(sections));
117
117
  };
118
118
  const showSubcommandHelp = (ctx, command) => {
119
119
  var _a;
@@ -158,7 +158,7 @@ const showSubcommandHelp = (ctx, command) => {
158
158
  if (subcommand.examples) {
159
159
  generateExamples(sections, subcommand.examples);
160
160
  }
161
- console.log(render(sections));
161
+ process.stdout.write(render(sections));
162
162
  };
163
163
  const helpPlugin = ({
164
164
  command = true,
@@ -189,13 +189,15 @@ const helpPlugin = ({
189
189
  }
190
190
  });
191
191
  }
192
- cli.inspector((ctx) => {
192
+ cli.inspector((ctx, next) => {
193
193
  if (ctx.raw.mergedFlags.h || ctx.raw.mergedFlags.help) {
194
194
  if (ctx.raw._.length) {
195
195
  showSubcommandHelp(ctx, ctx.raw._);
196
196
  } else {
197
197
  showHelp(ctx, notes, examples);
198
198
  }
199
+ } else {
200
+ next();
199
201
  }
200
202
  });
201
203
  return cli;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clerc/plugin-help",
3
- "version": "0.12.2",
3
+ "version": "0.12.4",
4
4
  "author": "Ray <nn_201312@163.com> (https://github.com/so1ve)",
5
5
  "description": "Clerc plugin help",
6
6
  "keywords": [
@@ -52,11 +52,11 @@
52
52
  },
53
53
  "dependencies": {
54
54
  "picocolors": "^1.0.0",
55
- "@clerc/toolkit": "0.12.2",
56
- "@clerc/utils": "0.12.2"
55
+ "@clerc/toolkit": "0.12.4",
56
+ "@clerc/utils": "0.12.4"
57
57
  },
58
58
  "devDependencies": {
59
- "@clerc/core": "0.12.2"
59
+ "@clerc/core": "0.12.4"
60
60
  },
61
61
  "scripts": {
62
62
  "build": "puild",