@oclif/plugin-which 2.2.10 → 2.2.12

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/README.md CHANGED
@@ -20,7 +20,7 @@ $ npm install -g @oclif/plugin-which
20
20
  $ oclif-example COMMAND
21
21
  running command...
22
22
  $ oclif-example (--version)
23
- @oclif/plugin-which/2.2.10 linux-x64 node-v18.13.0
23
+ @oclif/plugin-which/2.2.12 linux-x64 node-v18.13.0
24
24
  $ oclif-example --help [COMMAND]
25
25
  USAGE
26
26
  $ oclif-example COMMAND
@@ -48,5 +48,5 @@ EXAMPLES
48
48
  $ oclif-example which help
49
49
  ```
50
50
 
51
- _See code: [src/commands/which.ts](https://github.com/oclif/plugin-which/blob/v2.2.10/src/commands/which.ts)_
51
+ _See code: [src/commands/which.ts](https://github.com/oclif/plugin-which/blob/v2.2.12/src/commands/which.ts)_
52
52
  <!-- commandsstop -->
@@ -4,15 +4,15 @@ const core_1 = require("@oclif/core");
4
4
  class Which extends core_1.Command {
5
5
  async run() {
6
6
  const { argv } = await this.parse(Which);
7
+ if (argv.length === 0) {
8
+ throw new Error('"which" expects a command name. Try something like "which your:command:here" ');
9
+ }
7
10
  let command = argv;
8
11
  if (argv.length === 1 && typeof argv[0] === 'string') {
9
12
  // If this if statement is true then the command to find was passed in as a single string, e.g. `mycli which "my command"`
10
13
  // So we must use the topicSeparator to split it into an array
11
14
  command = argv[0].split(this.config.topicSeparator);
12
15
  }
13
- else {
14
- throw new Error('"which" expects a command name. Try something like "which your:command:here" ');
15
- }
16
16
  const cmd = this.config.findCommand(command.join(':'), { must: true });
17
17
  core_1.ux.styledHeader(command.join(this.config.topicSeparator));
18
18
  core_1.ux.styledObject({
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.2.10",
2
+ "version": "2.2.12",
3
3
  "commands": {
4
4
  "which": {
5
5
  "id": "which",
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@oclif/plugin-which",
3
3
  "description": "find which plugin a command is in",
4
- "version": "2.2.10",
4
+ "version": "2.2.12",
5
5
  "author": "Salesforce",
6
6
  "bugs": "https://github.com/oclif/plugin-which/issues",
7
7
  "dependencies": {
8
8
  "@oclif/core": "^2.0.7",
9
- "tslib": "^2.4.1"
9
+ "tslib": "^2.5.0"
10
10
  },
11
11
  "devDependencies": {
12
- "@oclif/plugin-help": "^5.2.0",
13
- "@oclif/test": "^2.3.1",
12
+ "@oclif/plugin-help": "^5.2.2",
13
+ "@oclif/test": "^2.3.4",
14
14
  "@types/chai": "^4.3.4",
15
15
  "@types/mocha": "^9",
16
16
  "@types/node": "^14.18.36",