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

restore --version output to pre-2.3 #10684

Merged
merged 1 commit into from Apr 1, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 9 additions & 8 deletions src/Composer/Console/Application.php
Expand Up @@ -557,17 +557,18 @@ protected function getDefaultCommands(): array

public function getLongVersion(): string
{
$branchAliasString = '';
if (Composer::BRANCH_ALIAS_VERSION && Composer::BRANCH_ALIAS_VERSION !== '@package_branch_alias_version'.'@') {
return sprintf(
'<info>%s</info> version <comment>%s (%s)</comment> %s',
$this->getName(),
Composer::BRANCH_ALIAS_VERSION,
$this->getVersion(),
Composer::RELEASE_DATE
);
$branchAliasString = sprintf(' (%s)', Composer::BRANCH_ALIAS_VERSION);
}

return parent::getLongVersion() . ' ' . Composer::RELEASE_DATE;
return sprintf(
'<info>%s</info> version <comment>%s%s</comment> %s',
$this->getName(),
$this->getVersion(),
$branchAliasString,
Composer::RELEASE_DATE
);
}

protected function getDefaultInputDefinition(): InputDefinition
Expand Down