1
0
Fork 0

fixed version output for show command

pull/1366/head
go.schmidt 2012-11-28 11:46:33 +01:00
parent c5f3a6febd
commit f748fb1953
1 changed files with 8 additions and 2 deletions

View File

@ -258,13 +258,19 @@ EOT
} }
uasort($versions, 'version_compare'); uasort($versions, 'version_compare');
$versions = implode(', ', array_keys(array_reverse($versions))); $versions = array_keys(array_reverse($versions));
// highlight installed version // highlight installed version
if ($installedRepo->hasPackage($package)) { if ($installedRepo->hasPackage($package)) {
$versions = str_replace($package->getPrettyVersion(), '<info>* ' . $package->getPrettyVersion() . '</info>', $versions); $installedVersion = $package->getPrettyVersion();
$key = array_search($installedVersion, $versions);
if (FALSE !== $key) {
$versions[$key] = '<info>* ' . $installedVersion . '</info>';
}
} }
$versions = implode(', ', $versions);
$output->writeln('<info>versions</info> : ' . $versions); $output->writeln('<info>versions</info> : ' . $versions);
} }