fix(Help): fixing the help command#4726
Conversation
| if (rawArgs.length > 0) { | ||
| if (cmd === rawArgs[0]) { | ||
| this.ui.writeLine(command.printDetailedHelp(commandOptions)); | ||
| this.ui.writeLine(command.printBasicHelp(commandOptions)); |
There was a problem hiding this comment.
So we changed this line multiple times. Could you investigate where we have detailed help and where we don't, so that we can print detailed if it exists, and basic if it doesn't?
There was a problem hiding this comment.
There is no implementation of printDetailedHelp It should be implemented for each task.
https://github.com/angular/angular-cli/blob/master/packages/%40angular/cli/ember-cli/lib/models/command.js#L433
We haven't implemented it on any except below mentioned.
- https://github.com/angular/angular-cli/blob/master/packages/%40angular/cli/commands/generate.ts#L41
- https://github.com/angular/angular-cli/blob/master/packages/%40angular/cli/ember-cli/lib/commands/generate.js#L67
- https://github.com/angular/angular-cli/blob/master/packages/%40angular/cli/ember-cli/lib/models/blueprint.js#L1122
There was a problem hiding this comment.
Yes, the bug we were solving was regarding blueprints.
Here's the PR that changed it: #4267
So basically if there's detailed help, show that. If not, show basic.
There was a problem hiding this comment.
But we are not checking whether detailed help is there or not as both the functions would exist on the command itself. One way to do is to remove the printDetailedHelp from Command prototype and above add this check.
if (command.printDetailedHelp) {
this.ui.writeLine(command.printDetailedHelp(commandOptions));
} else {
this.ui.writeLine(command.printBasicHelp(commandOptions));
}0ceb317 to
46f2019
Compare
| if (rawArgs.length > 0) { | ||
| if (cmd === rawArgs[0]) { | ||
| this.ui.writeLine(command.printDetailedHelp(commandOptions)); | ||
| if (command.printDetailedHelp) { |
There was a problem hiding this comment.
Why not just call it, and check that the return value is not undefined?
46f2019 to
3cbdb18
Compare
|
LGTM. Thanks! |
|
@sumitarora In the future use the package name ( |
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
No description provided.