@oclif/plugin-which 2.2.11 → 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 +2 -2
- package/lib/commands/which.js +3 -3
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
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.
|
|
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.
|
|
51
|
+
_See code: [src/commands/which.ts](https://github.com/oclif/plugin-which/blob/v2.2.12/src/commands/which.ts)_
|
|
52
52
|
<!-- commandsstop -->
|
package/lib/commands/which.js
CHANGED
|
@@ -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({
|
package/oclif.manifest.json
CHANGED
package/package.json
CHANGED