Add links to repo to show/outdated commands package lists, fixes #9367
parent
711f436b24
commit
06bb3c9179
|
@ -326,6 +326,7 @@ EOT
|
||||||
}
|
}
|
||||||
|
|
||||||
// list packages
|
// list packages
|
||||||
|
/** @var array<string, array<string, string|CompletePackageInterface>> $packages */
|
||||||
$packages = array();
|
$packages = array();
|
||||||
$packageFilterRegex = null;
|
$packageFilterRegex = null;
|
||||||
if (null !== $packageFilter) {
|
if (null !== $packageFilter) {
|
||||||
|
@ -437,6 +438,14 @@ EOT
|
||||||
}
|
}
|
||||||
|
|
||||||
$packageViewData['name'] = $package->getPrettyName();
|
$packageViewData['name'] = $package->getPrettyName();
|
||||||
|
if ($format !== 'json' || true !== $input->getOption('name-only')) {
|
||||||
|
$packageViewData['homepage'] = $package->getHomepage();
|
||||||
|
if (isset($package->getSupport()['source'])) {
|
||||||
|
$packageViewData['source'] = $package->getSupport()['source'];
|
||||||
|
} elseif (null !== $package->getSourceUrl()) {
|
||||||
|
$packageViewData['source'] = $package->getSourceUrl();
|
||||||
|
}
|
||||||
|
}
|
||||||
$nameLength = max($nameLength, strlen($package->getPrettyName()));
|
$nameLength = max($nameLength, strlen($package->getPrettyName()));
|
||||||
if ($writeVersion) {
|
if ($writeVersion) {
|
||||||
$packageViewData['version'] = $package->getFullPrettyVersion();
|
$packageViewData['version'] = $package->getFullPrettyVersion();
|
||||||
|
@ -528,7 +537,12 @@ EOT
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($packages as $package) {
|
foreach ($packages as $package) {
|
||||||
$io->write($indent . str_pad($package['name'], $nameLength, ' '), false);
|
$link = $package['source'] ?? $package['homepage'] ?? '';
|
||||||
|
if ($link) {
|
||||||
|
$io->write($indent . '<href='.str_replace('>', '', $link).'>'.$package['name'].'</>'. str_repeat(' ', $nameLength - strlen($package['name'])), false);
|
||||||
|
} else {
|
||||||
|
$io->write($indent . str_pad($package['name'], $nameLength, ' '), false);
|
||||||
|
}
|
||||||
if (isset($package['version']) && $writeVersion) {
|
if (isset($package['version']) && $writeVersion) {
|
||||||
$io->write(' ' . str_pad($package['version'], $versionLength, ' '), false);
|
$io->write(' ' . str_pad($package['version'], $versionLength, ' '), false);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue