-
Notifications
You must be signed in to change notification settings - Fork 12k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(Help): fixing the help command #4726
Conversation
@@ -56,7 +56,7 @@ const HelpCommand = Command.extend({ | |||
|
|||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
@@ -56,7 +56,11 @@ const HelpCommand = Command.extend({ | |||
|
|||
if (rawArgs.length > 0) { | |||
if (cmd === rawArgs[0]) { | |||
this.ui.writeLine(command.printDetailedHelp(commandOptions)); | |||
if (command.printDetailedHelp) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just call it, and check that the return value is not undefined?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
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.