Browse Source

Show version for platform/installed packages, fixes #825

Jordi Boggiano 12 years ago
parent
commit
fd776853a4
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/Composer/Command/ShowCommand.php

+ 2 - 2
src/Composer/Command/ShowCommand.php

@@ -110,12 +110,12 @@ EOT
             $packages[$type][$package->getName()] = $package;
         }
 
-        foreach (array('<info>platform</info>:', '<comment>available</comment>:', '<info>installed</info>:') as $type) {
+        foreach (array('<info>platform</info>:' => true, '<comment>available</comment>:' => false, '<info>installed</info>:' => true) as $type => $showVersion) {
             if (isset($packages[$type])) {
                 $output->writeln($type);
                 ksort($packages[$type]);
                 foreach ($packages[$type] as $package) {
-                    $output->writeln('  '.$package->getPrettyName() .' <comment>:</comment> '. strtok($package->getDescription(), "\r\n"));
+                    $output->writeln('  '.$package->getPrettyName() .' '.($showVersion ? '['.$package->getPrettyVersion().']' : '').' <comment>:</comment> '. strtok($package->getDescription(), "\r\n"));
                 }
                 $output->writeln('');
             }