@clerc/plugin-help 0.7.0 → 0.8.1

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.cjs CHANGED
@@ -90,7 +90,7 @@ const helpPlugin = (_options) => clerc.definePlugin({
90
90
  });
91
91
  function showHelp(ctx, { examples, notes }) {
92
92
  const { cli } = ctx;
93
- if (ctx.raw._.length > 0) {
93
+ if (ctx.resolved && ctx.parameters.command.length > 0) {
94
94
  showSubcommandHelp(ctx);
95
95
  return;
96
96
  }
@@ -139,7 +139,7 @@ function showCommandNotes(notes) {
139
139
  }
140
140
  function showSubcommandHelp(ctx) {
141
141
  const { cli } = ctx;
142
- const commandName = ctx.raw._.map(String);
142
+ const commandName = ctx.parameters.command;
143
143
  const commandToShowHelp = clerc.resolveCommand(cli._commands, commandName);
144
144
  if (!commandToShowHelp) {
145
145
  throw new clerc.NoSuchCommandError(commandName.join(" "));
package/dist/index.mjs CHANGED
@@ -82,7 +82,7 @@ const helpPlugin = (_options) => definePlugin({
82
82
  });
83
83
  function showHelp(ctx, { examples, notes }) {
84
84
  const { cli } = ctx;
85
- if (ctx.raw._.length > 0) {
85
+ if (ctx.resolved && ctx.parameters.command.length > 0) {
86
86
  showSubcommandHelp(ctx);
87
87
  return;
88
88
  }
@@ -131,7 +131,7 @@ function showCommandNotes(notes) {
131
131
  }
132
132
  function showSubcommandHelp(ctx) {
133
133
  const { cli } = ctx;
134
- const commandName = ctx.raw._.map(String);
134
+ const commandName = ctx.parameters.command;
135
135
  const commandToShowHelp = resolveCommand(cli._commands, commandName);
136
136
  if (!commandToShowHelp) {
137
137
  throw new NoSuchCommandError(commandName.join(" "));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clerc/plugin-help",
3
- "version": "0.7.0",
3
+ "version": "0.8.1",
4
4
  "author": "Ray <nn_201312@163.com> (https://github.com/so1ve)",
5
5
  "description": "Clerc plugin help",
6
6
  "keywords": [
@@ -43,8 +43,8 @@
43
43
  "clerc": "*"
44
44
  },
45
45
  "dependencies": {
46
- "@clerc/utils": "0.7.0",
47
- "clerc": "0.7.0",
46
+ "@clerc/utils": "npm:@clerc/toolkit@0.8.1",
47
+ "clerc": "0.8.1",
48
48
  "picocolors": "^1.0.0"
49
49
  },
50
50
  "scripts": {