@oclif/core 0.5.35 → 0.5.36
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 +7 -0
- package/lib/help/index.d.ts +1 -0
- package/lib/help/index.js +5 -1
- package/lib/main.js +0 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [0.5.36](https://github.com/oclif/core/compare/v0.5.35...v0.5.36) (2021-09-14)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* move ctor for command help class to its own function ([#244](https://github.com/oclif/core/issues/244)) ([26f2445](https://github.com/oclif/core/commit/26f24457c71276c38f86821c2b1498ecb8e4e2a4))
|
|
11
|
+
|
|
5
12
|
### [0.5.35](https://github.com/oclif/core/compare/v0.5.34...v0.5.35) (2021-09-08)
|
|
6
13
|
|
|
7
14
|
|
package/lib/help/index.d.ts
CHANGED
|
@@ -30,6 +30,7 @@ export declare class Help extends HelpBase {
|
|
|
30
30
|
protected showTopicHelp(topic: Interfaces.Topic): Promise<void>;
|
|
31
31
|
protected formatRoot(): string;
|
|
32
32
|
protected formatCommand(command: Interfaces.Command): string;
|
|
33
|
+
protected getCommandHelpClass(command: Interfaces.Command): CommandHelp;
|
|
33
34
|
protected formatCommands(commands: Interfaces.Command[]): string;
|
|
34
35
|
protected summary(c: Interfaces.Command): string | undefined;
|
|
35
36
|
protected description(c: Interfaces.Command): string;
|
package/lib/help/index.js
CHANGED
|
@@ -73,6 +73,7 @@ class Help extends HelpBase {
|
|
|
73
73
|
return topics;
|
|
74
74
|
}
|
|
75
75
|
async showHelp(argv) {
|
|
76
|
+
argv = argv.filter(arg => !getHelpFlagAdditions(this.config).includes(arg));
|
|
76
77
|
if (this.config.topicSeparator !== ':')
|
|
77
78
|
argv = util_2.standardizeIDFromArgv(argv, this.config);
|
|
78
79
|
const subject = getHelpSubject(argv, this.config);
|
|
@@ -172,9 +173,12 @@ class Help extends HelpBase {
|
|
|
172
173
|
command.id = command.id.replace(/:/g, this.config.topicSeparator);
|
|
173
174
|
command.aliases = command.aliases && command.aliases.map(a => a.replace(/:/g, this.config.topicSeparator));
|
|
174
175
|
}
|
|
175
|
-
const help =
|
|
176
|
+
const help = this.getCommandHelpClass(command);
|
|
176
177
|
return help.generate();
|
|
177
178
|
}
|
|
179
|
+
getCommandHelpClass(command) {
|
|
180
|
+
return new this.CommandHelpClass(command, this.config, this.opts);
|
|
181
|
+
}
|
|
178
182
|
formatCommands(commands) {
|
|
179
183
|
if (commands.length === 0)
|
|
180
184
|
return '';
|
package/lib/main.js
CHANGED
|
@@ -49,7 +49,6 @@ async function run(argv = process.argv.slice(2), options) {
|
|
|
49
49
|
}
|
|
50
50
|
// display help version if applicable
|
|
51
51
|
if (exports.helpAddition(argv, config)) {
|
|
52
|
-
argv = argv.filter(arg => !help_1.getHelpFlagAdditions(config).includes(arg));
|
|
53
52
|
const Help = await help_1.loadHelpClass(config);
|
|
54
53
|
const help = new Help(config, config.pjson.helpOptions);
|
|
55
54
|
await help.showHelp(argv);
|