-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Console] Display console application name even when no version set #17326
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
@@ -324,6 +324,8 @@ public function getLongVersion() | |||
{ | |||
if ('UNKNOWN' !== $this->getName() && 'UNKNOWN' !== $this->getVersion()) { | |||
return sprintf('<info>%s</info> version <comment>%s</comment>', $this->getName(), $this->getVersion()); | |||
} else if ('UNKNOWN' !== $this->getName()) { |
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.
else
is not required here.
👍 |
@@ -325,6 +325,9 @@ public function getLongVersion() | |||
if ('UNKNOWN' !== $this->getName() && 'UNKNOWN' !== $this->getVersion()) { | |||
return sprintf('<info>%s</info> version <comment>%s</comment>', $this->getName(), $this->getVersion()); | |||
} | |||
if ('UNKNOWN' !== $this->getName()) { | |||
return sprintf('<info>%s</info>', $this->getName()); | |||
} |
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.
More clear would be IMO:
if ('UNKNOWN' !== $this->getName()) {
if ('UNKNOWN' !== $this->getVersion()) {
return sprintf('<info>%s</info> version <comment>%s</comment>', $this->getName(), $this->getVersion());
}
return sprintf('<info>%s</info>', $this->getName());
}
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.
It's what I had done at first but I thought I was less clear. Anyway I can change no problems !
👍 |
Thank you @polc. |
…rsion set (polc) This PR was squashed before being merged into the 2.3 branch (closes #17326). Discussion ---------- [Console] Display console application name even when no version set | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | License | MIT When displaying help of an Application with a name but no version, it show "Console Tool" instead of the application name. Commits ------- 61e810e [Console] Display console application name even when no version set
When displaying help of an Application with a name but no version, it show "Console Tool" instead of the application name.