diff --git a/src/Composer/Command/SearchCommand.php b/src/Composer/Command/SearchCommand.php index a4e63198b..78ed6cab0 100644 --- a/src/Composer/Command/SearchCommand.php +++ b/src/Composer/Command/SearchCommand.php @@ -93,12 +93,13 @@ EOT $nameLength += 1; foreach ($results as $result) { $description = isset($result['description']) ? $result['description'] : ''; - $remaining = $width - $nameLength - 2; + $warning = !empty($result['abandoned']) ? '! Abandoned ! ' : ''; + $remaining = $width - $nameLength - strlen($warning) - 2; if (strlen($description) > $remaining) { $description = substr($description, 0, $remaining - 3) . '...'; } - $io->write(str_pad($result['name'], $nameLength, ' ') . $description); + $io->write(str_pad($result['name'], $nameLength, ' ') . $warning . $description); } } elseif ($format === 'json') { $io->write(JsonFile::encode($results));