1
0
Fork 0

Suggest using -p when a platform package can not be found in show command

pull/8534/head
Jordi Boggiano 2020-01-17 14:52:07 +01:00
parent 1f261f1f7a
commit b9d00153d9
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 3 additions and 0 deletions

View File

@ -201,6 +201,9 @@ EOT
if (empty($package)) { if (empty($package)) {
$options = $input->getOptions(); $options = $input->getOptions();
if (!isset($options['working-dir']) || !file_exists('composer.json')) { if (!isset($options['working-dir']) || !file_exists('composer.json')) {
if (preg_match(PlatformRepository::PLATFORM_PACKAGE_REGEX, $input->getArgument('package')) && !$input->getOption('platform')) {
throw new \InvalidArgumentException('Package ' . $packageFilter . ' not found, try using --platform (-p) to show platform packages.');
}
throw new \InvalidArgumentException('Package ' . $packageFilter . ' not found'); throw new \InvalidArgumentException('Package ' . $packageFilter . ' not found');
} }