@oclif/plugin-help 3.1.0 → 3.2.0

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/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ # [3.2.0](https://github.com/oclif/plugin-help/compare/v3.1.0...v3.2.0) (2020-08-03)
2
+
3
+
4
+ ### Features
5
+
6
+ * support src/command/index cmd ([#112](https://github.com/oclif/plugin-help/issues/112)) ([8957336](https://github.com/oclif/plugin-help/commit/8957336f3c35675bb243ac90c49c298fbef23e59))
7
+
1
8
  ## [2.1.4](https://github.com/oclif/plugin-help/compare/v2.1.3...v2.1.4) (2018-11-12)
2
9
 
3
10
 
package/lib/index.js CHANGED
@@ -13,14 +13,15 @@ const util_2 = require("./util");
13
13
  exports.getHelpClass = util_2.getHelpClass;
14
14
  const wrap = require('wrap-ansi');
15
15
  const { bold, } = chalk_1.default;
16
+ const ROOT_INDEX_CMD_ID = '';
16
17
  function getHelpSubject(args) {
17
18
  for (const arg of args) {
18
19
  if (arg === '--')
19
20
  return;
20
- if (arg.startsWith('-'))
21
- continue;
22
- if (arg === 'help')
21
+ if (arg === 'help' || arg === '--help' || arg === '-h')
23
22
  continue;
23
+ if (arg.startsWith('-'))
24
+ return;
24
25
  return arg;
25
26
  }
26
27
  }
@@ -66,6 +67,9 @@ class Help extends HelpBase {
66
67
  showHelp(argv) {
67
68
  const subject = getHelpSubject(argv);
68
69
  if (!subject) {
70
+ const rootCmd = this.config.findCommand(ROOT_INDEX_CMD_ID);
71
+ if (rootCmd)
72
+ this.showCommandHelp(rootCmd);
69
73
  this.showRootHelp();
70
74
  return;
71
75
  }
@@ -114,6 +118,7 @@ class Help extends HelpBase {
114
118
  console.log('');
115
119
  }
116
120
  if (rootCommands.length > 0) {
121
+ rootCommands = rootCommands.filter(c => c.id);
117
122
  console.log(this.formatCommands(rootCommands));
118
123
  console.log('');
119
124
  }
@@ -1 +1 @@
1
- {"version":"3.1.0","commands":{"help":{"id":"help","description":"display help for <%= config.bin %>","pluginName":"@oclif/plugin-help","pluginType":"core","aliases":[],"flags":{"all":{"name":"all","type":"boolean","description":"see all commands in CLI","allowNo":false}},"args":[{"name":"command","description":"command to show help for","required":false}]}}}
1
+ {"version":"3.2.0","commands":{"help":{"id":"help","description":"display help for <%= config.bin %>","pluginName":"@oclif/plugin-help","pluginType":"core","aliases":[],"flags":{"all":{"name":"all","type":"boolean","description":"see all commands in CLI","allowNo":false}},"args":[{"name":"command","description":"command to show help for","required":false}]}}}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@oclif/plugin-help",
3
3
  "description": "standard help for oclif",
4
- "version": "3.1.0",
4
+ "version": "3.2.0",
5
5
  "author": "Jeff Dickey @jdxcode",
6
6
  "bugs": "https://github.com/oclif/plugin-help/issues",
7
7
  "dependencies": {
@@ -10,9 +10,9 @@
10
10
  "chalk": "^2.4.1",
11
11
  "indent-string": "^4.0.0",
12
12
  "lodash.template": "^4.4.0",
13
- "string-width": "^3.0.0",
14
- "strip-ansi": "^5.0.0",
15
- "widest-line": "^2.0.1",
13
+ "string-width": "^4.2.0",
14
+ "strip-ansi": "^6.0.0",
15
+ "widest-line": "^3.1.0",
16
16
  "wrap-ansi": "^4.0.0"
17
17
  },
18
18
  "devDependencies": {
@@ -23,20 +23,20 @@
23
23
  "@oclif/test": "^1.2.2",
24
24
  "@types/chai": "^4.1.7",
25
25
  "@types/lodash.template": "^4.4.4",
26
- "@types/mocha": "^5.2.5",
27
- "@types/node": "^8.10.59",
28
- "@types/strip-ansi": "^3.0.0",
26
+ "@types/mocha": "^8.0.0",
27
+ "@types/node": "^14.0.14",
28
+ "@types/strip-ansi": "^5.2.1",
29
29
  "@types/wrap-ansi": "^3.0.0",
30
30
  "chai": "^4.2.0",
31
- "eslint": "^6.6.0",
31
+ "eslint": "^7.3.1",
32
32
  "eslint-config-oclif": "^3.1.0",
33
- "eslint-config-oclif-typescript": "^0.1.0",
34
- "globby": "^9.0.0",
33
+ "eslint-config-oclif-typescript": "^0.2.0",
34
+ "globby": "^11.0.1",
35
35
  "mocha": "^5.2.0",
36
- "nock": "^12.0.3",
36
+ "nock": "^13.0.0",
37
37
  "sinon": "^9.0.1",
38
38
  "ts-node": "^8.8.2",
39
- "typescript": "^3.8.3"
39
+ "typescript": "3.8.3"
40
40
  },
41
41
  "engines": {
42
42
  "node": ">=8.0.0"
@@ -63,7 +63,7 @@
63
63
  "scripts": {
64
64
  "build": "rm -rf lib && tsc",
65
65
  "lint": "eslint . --ext .ts --config .eslintrc",
66
- "pretest": "tsc -p test --noEmit",
66
+ "pretest": "yarn build --noEmit && tsc -p test --noEmit",
67
67
  "test": "mocha --forbid-only \"test/**/*.test.ts\"",
68
68
  "posttest": "yarn lint",
69
69
  "prepack": "yarn run build && oclif-dev manifest",