@oclif/plugin-which 3.1.10 → 3.2.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/README.md CHANGED
@@ -21,7 +21,7 @@ $ npm install -g @oclif/plugin-which
21
21
  $ oclif-example COMMAND
22
22
  running command...
23
23
  $ oclif-example (--version)
24
- @oclif/plugin-which/3.1.10 linux-x64 node-v20.12.2
24
+ @oclif/plugin-which/3.2.1 linux-x64 node-v20.13.1
25
25
  $ oclif-example --help [COMMAND]
26
26
  USAGE
27
27
  $ oclif-example COMMAND
@@ -52,9 +52,21 @@ EXAMPLES
52
52
  See which plugin the `help` command is in:
53
53
 
54
54
  $ oclif-example which help
55
+
56
+ Use colon separators.
57
+
58
+ $ oclif-example which foo:bar:baz
59
+
60
+ Use spaces as separators.
61
+
62
+ $ oclif-example which foo bar baz
63
+
64
+ Wrap command in quotes to use spaces as separators.
65
+
66
+ $ oclif-example which "foo bar baz"
55
67
  ```
56
68
 
57
- _See code: [src/commands/which.ts](https://github.com/oclif/plugin-which/blob/v3.1.10/src/commands/which.ts)_
69
+ _See code: [src/commands/which.ts](https://github.com/oclif/plugin-which/blob/v3.2.1/src/commands/which.ts)_
58
70
  <!-- commandsstop -->
59
71
 
60
72
  # Contributing
@@ -1,4 +1,5 @@
1
- import { Command, Errors, toConfiguredId, ux } from '@oclif/core';
1
+ import { Command, toConfiguredId } from '@oclif/core';
2
+ import { bold, cyan } from 'ansis';
2
3
  export default class Which extends Command {
3
4
  static description = 'Show which plugin a command is in.';
4
5
  static enableJsonFlag = true;
@@ -7,12 +8,24 @@ export default class Which extends Command {
7
8
  command: '<%= config.bin %> <%= command.id %> help',
8
9
  description: 'See which plugin the `help` command is in:',
9
10
  },
11
+ {
12
+ command: '<%= config.bin %> <%= command.id %> foo:bar:baz',
13
+ description: 'Use colon separators.',
14
+ },
15
+ {
16
+ command: '<%= config.bin %> <%= command.id %> foo bar baz',
17
+ description: 'Use spaces as separators.',
18
+ },
19
+ {
20
+ command: '<%= config.bin %> <%= command.id %> "foo bar baz"',
21
+ description: 'Wrap command in quotes to use spaces as separators.',
22
+ },
10
23
  ];
11
24
  static strict = false;
12
25
  async run() {
13
26
  const { argv } = await this.parse(Which);
14
27
  if (argv.length === 0) {
15
- throw new Errors.CLIError('"which" expects a command name', {
28
+ this.error('"which" expects a command name', {
16
29
  suggestions: [`Provide a command id like this, "${this.config.bin} which your:command:here"`],
17
30
  });
18
31
  }
@@ -29,8 +42,11 @@ export default class Which extends Command {
29
42
  }
30
43
  }
31
44
  if (!this.jsonEnabled()) {
32
- ux.styledHeader(commandParts.join(this.config.topicSeparator));
33
- ux.styledObject(result);
45
+ this.log(bold(commandParts.join(this.config.topicSeparator)) + '\n');
46
+ this.log(`${cyan('plugin')}: ${result.plugin}`);
47
+ if (result.aliasOf) {
48
+ this.log(`${cyan('aliasOf')}: ${result.aliasOf}`);
49
+ }
34
50
  }
35
51
  return result;
36
52
  }
@@ -8,6 +8,18 @@
8
8
  {
9
9
  "command": "<%= config.bin %> <%= command.id %> help",
10
10
  "description": "See which plugin the `help` command is in:"
11
+ },
12
+ {
13
+ "command": "<%= config.bin %> <%= command.id %> foo:bar:baz",
14
+ "description": "Use colon separators."
15
+ },
16
+ {
17
+ "command": "<%= config.bin %> <%= command.id %> foo bar baz",
18
+ "description": "Use spaces as separators."
19
+ },
20
+ {
21
+ "command": "<%= config.bin %> <%= command.id %> \"foo bar baz\"",
22
+ "description": "Wrap command in quotes to use spaces as separators."
11
23
  }
12
24
  ],
13
25
  "flags": {
@@ -39,5 +51,5 @@
39
51
  ]
40
52
  }
41
53
  },
42
- "version": "3.1.10"
54
+ "version": "3.2.1"
43
55
  }
package/package.json CHANGED
@@ -1,22 +1,23 @@
1
1
  {
2
2
  "name": "@oclif/plugin-which",
3
3
  "description": "find which plugin a command is in",
4
- "version": "3.1.10",
4
+ "version": "3.2.1",
5
5
  "author": "Salesforce",
6
6
  "bugs": "https://github.com/oclif/plugin-which/issues",
7
7
  "dependencies": {
8
- "@oclif/core": "^3.26.6"
8
+ "@oclif/core": "^4",
9
+ "ansis": "^3.2.0"
9
10
  },
10
11
  "devDependencies": {
11
- "@commitlint/config-conventional": "^18",
12
+ "@commitlint/config-conventional": "^19",
12
13
  "@oclif/plugin-help": "^6",
13
14
  "@oclif/prettier-config": "^0.2.1",
15
+ "@oclif/test": "^4.0.2",
14
16
  "@types/chai": "^4.3.11",
15
17
  "@types/mocha": "^10.0.6",
16
18
  "@types/node": "^18",
17
- "@types/sinon": "^17.0.3",
18
19
  "chai": "^4.4.1",
19
- "commitlint": "^18",
20
+ "commitlint": "^19",
20
21
  "eslint": "^8.57.0",
21
22
  "eslint-config-oclif": "^5.2.0",
22
23
  "eslint-config-oclif-typescript": "^3.1.7",
@@ -25,10 +26,9 @@
25
26
  "lint-staged": "^15",
26
27
  "mocha": "^10.4.0",
27
28
  "nyc": "^15.1.0",
28
- "oclif": "^4.10.7",
29
+ "oclif": "^4.12.0",
29
30
  "prettier": "^3.2.5",
30
31
  "shx": "^0.3.4",
31
- "sinon": "^17.0.1",
32
32
  "ts-node": "^10.9.2",
33
33
  "typescript": "^5.4.5"
34
34
  },