Skip to content

Commit 5781bbc

Browse files
committed
bug #17326 [Console] Display console application name even when no version 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
2 parents c8c9477 + 61e810e commit 5781bbc

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Symfony/Component/Console/Application.php

+6-2
Original file line numberDiff line numberDiff line change
@@ -322,8 +322,12 @@ public function setVersion($version)
322322
*/
323323
public function getLongVersion()
324324
{
325-
if ('UNKNOWN' !== $this->getName() && 'UNKNOWN' !== $this->getVersion()) {
326-
return sprintf('<info>%s</info> version <comment>%s</comment>', $this->getName(), $this->getVersion());
325+
if ('UNKNOWN' !== $this->getName()) {
326+
if ('UNKNOWN' !== $this->getVersion()) {
327+
return sprintf('<info>%s</info> version <comment>%s</comment>', $this->getName(), $this->getVersion());
328+
}
329+
330+
return sprintf('<info>%s</info>', $this->getName());
327331
}
328332

329333
return '<info>Console Tool</info>';

0 commit comments

Comments
 (0)