Add abandoned flag in search command output

main
Jordi Boggiano 3 years ago
parent 9e762a4f9a
commit 85f3bb070d
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC

@ -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']) ? '<warning>! Abandoned !</warning> ' : '';
$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));

Loading…
Cancel
Save