diff --git a/src/Composer/Command/ShowCommand.php b/src/Composer/Command/ShowCommand.php
index 6e3123fe4..226ca8dd7 100644
--- a/src/Composer/Command/ShowCommand.php
+++ b/src/Composer/Command/ShowCommand.php
@@ -272,9 +272,6 @@ EOT
$latestPackages = array();
foreach (array('platform:' => true, 'available:' => false, 'installed:' => true) as $type => $showVersion) {
if (isset($packages[$type])) {
- if ($showAllTypes) {
- $io->write($type);
- }
ksort($packages[$type]);
$nameLength = $versionLength = $latestLength = 0;
@@ -321,6 +318,10 @@ EOT
$latestLength += 2;
}
$hasOutdatedPackages = false;
+
+ if ($showAllTypes) {
+ $io->write($type);
+ }
foreach ($packages[$type] as $package) {
if (is_object($package)) {
$latestPackage = null;