-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Console] [DX] Fix command description/help display #26439
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
Conversation
$this->writeText(' '.$description); | ||
$this->writeText("\n\n"); | ||
} | ||
|
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.
should as well the $command->getProcessedHelp()
return only the $command->getHelp()
and not sometimes the $command->getDescription()
? so description will be only on top and not at the bottom?
line https://github.com/symfony/symfony/pull/26439/files#diff-f21e3938d69281cd0815f081627d9c34R164
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.
I think it should yes, it's weird that getProcessedHelp()
can return the description., but I'm not sure it's fine to change it now. Instead, could we display the Help
section (calling getProcessedHelp()
) only if getHelp()
is not null? or only if getProcessedHelp() !== getDescription()
?
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.
@chalasr ok, I will change the called method here
@noniagriconomie For other descriptors, I also think they don't need to be updated. In fact, the TextDescriptor seems to be the only one that does not contain the description. By the way, I must say that you're working on a part which is quite hard to update and not very "first-time-contribution friendly" (not contribution friendly at all in fact), and you just do it perfectly for now! |
4884d3e
to
3eb652c
Compare
@chalasr PR code updated accordingly |
@@ -154,7 +161,8 @@ protected function describeCommand(Command $command, array $options = array()) | |||
$this->writeText("\n"); | |||
} | |||
|
|||
if ($help = $command->getProcessedHelp()) { | |||
$help = $command->getProcessedHelp(); | |||
if ($help !== $command->getDescription()) { |
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.
should be $help && $help !== $description
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.
👍 change is done @chalasr
3eb652c
to
68d9365
Compare
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.
@noniagriconomie I love DX issues, so thanks a lot for contributing this one. And congrats on your first Symfony contribution!
@javiereguiluz hope this help a lot of sf devs :) |
@noniagriconomie Thanks for the pull request. I don't think this qualifies as a bug. So, I'm going to merge it into master into 2.7. |
Thank you @noniagriconomie. |
This PR was merged into the 4.1-dev branch. Discussion ---------- [Console] Fix tests | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files --> | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | no <!-- don't forget to update UPGRADE-*.md files --> | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | N/A <!-- #-prefixed issue number(s), if any --> | License | MIT | Doc PR | N/A Fix Console tests after #26439 merge. Commits ------- c429fa0 [Console] Fix tests
Hi,
Here is a fix for the issue #26376
I only patch the text descriptor, should I do it for others?
(I do not think so as the main and default one is text)
Thanks