diff --git a/src/Composer/Command/OutdatedCommand.php b/src/Composer/Command/OutdatedCommand.php index 3b6808cd3..80a574455 100644 --- a/src/Composer/Command/OutdatedCommand.php +++ b/src/Composer/Command/OutdatedCommand.php @@ -39,13 +39,13 @@ class OutdatedCommand extends ShowCommand ->setHelp(<<green: Dependency is in the latest version and is up to date. -- yellow: Dependency has a new version available that includes backwards +- green (=): Dependency is in the latest version and is up to date. +- yellow (~): Dependency has a new version available that includes backwards compatibility breaks according to semver, so upgrade when you can but it may involve work. -- red: Dependency has a new version that is semver-compatible and you should upgrade it. +- red (!): Dependency has a new version that is semver-compatible and you should upgrade it. EOT diff --git a/src/Composer/Command/ShowCommand.php b/src/Composer/Command/ShowCommand.php index 43e566fc2..ffc2af132 100644 --- a/src/Composer/Command/ShowCommand.php +++ b/src/Composer/Command/ShowCommand.php @@ -317,6 +317,9 @@ EOT $writeVersion = !$input->getOption('name-only') && !$input->getOption('path') && $showVersion && ($nameLength + $versionLength + 3 <= $width); $writeLatest = $writeVersion && $showLatest && ($nameLength + $versionLength + $latestLength + 3 <= $width); $writeDescription = !$input->getOption('name-only') && !$input->getOption('path') && ($nameLength + $versionLength + $latestLength + 24 <= $width); + if ($writeLatest && !$io->isDecorated()) { + $latestLength += 2; + } $hasOutdatedPackages = false; foreach ($packages[$type] as $package) { if (is_object($package)) { @@ -339,6 +342,9 @@ EOT if ($writeLatest && $latestPackackage) { $latestVersion = $latestPackackage->getFullPrettyVersion(); $style = $this->getVersionStyle($latestPackackage, $package); + if (!$io->isDecorated()) { + $latestVersion = str_replace(array('info', 'highlight', 'comment'), array('=', '!', '~'), $style) . ' ' . $latestVersion; + } $io->write(' <'.$style.'>' . str_pad($latestVersion, $latestLength, ' ') . '', false); }