Skip to content
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

Merged
merged 1 commit into from
Feb 17, 2017

Conversation

sumitarora
Copy link
Contributor

No description provided.

@@ -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));
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

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.

Copy link
Contributor Author

@sumitarora sumitarora Feb 16, 2017

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));
}

@sumitarora sumitarora force-pushed the feat-help-command branch 3 times, most recently from 0ceb317 to 46f2019 Compare February 16, 2017 18:18
@@ -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) {
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@hansl
Copy link
Contributor

hansl commented Feb 17, 2017

LGTM. Thanks!

@hansl hansl merged commit 121c390 into angular:master Feb 17, 2017
@hansl
Copy link
Contributor

hansl commented Feb 17, 2017

@sumitarora In the future use the package name (@angular/cli) in the commit title, instead of the command. Thanks :)

@sumitarora sumitarora deleted the feat-help-command branch March 24, 2017 16:35
asnowwolf pushed a commit to asnowwolf/angular-cli that referenced this pull request Apr 12, 2017
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants