1
0
Fork 0

Add legend for outdated and show --latest commands, fixes #9716

pull/9915/head
Jordi Boggiano 2021-05-24 22:16:58 +02:00
parent 7888d3fb97
commit 6ac5b46607
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 18 additions and 0 deletions

View File

@ -475,6 +475,24 @@ EOT
if ('json' === $format) { if ('json' === $format) {
$io->write(JsonFile::encode($viewData)); $io->write(JsonFile::encode($viewData));
} else { } else {
if ($input->getOption('latest')) {
if (!$io->isDecorated()) {
$io->writeError('Legend:');
$io->writeError('! patch or minor release available - update recommended');
$io->writeError('~ major release available - update possible');
if (!$input->getOption('outdated')) {
$io->writeError('= up to date version');
}
} else {
$io->writeError('<info>Color legend:</info>');
$io->writeError('- <comment>patch or minor</comment> release available - update recommended');
$io->writeError('- <highlight>major</highlight> release available - update possible');
if (!$input->getOption('outdated')) {
$io->writeError('- <info>up to date</info> version');
}
}
}
$width = $this->getTerminalWidth(); $width = $this->getTerminalWidth();
foreach ($viewData as $type => $packages) { foreach ($viewData as $type => $packages) {