1
0
Fork 0

Print error message when json is requested for tree or single package info

pull/6228/head
Alexander Schwenn 2017-03-06 00:29:20 +01:00
parent 74d82a51e3
commit 527f5b8571
1 changed files with 6 additions and 0 deletions

View File

@ -172,6 +172,9 @@ EOT
// show single package or single version // show single package or single version
if (($packageFilter && false === strpos($packageFilter, '*')) || !empty($package)) { if (($packageFilter && false === strpos($packageFilter, '*')) || !empty($package)) {
if ('json' === $format) {
$io->writeError('Format "json" is only supported for package listings, falling back to format "text"');
}
if (empty($package)) { if (empty($package)) {
list($package, $versions) = $this->getPackage($installedRepo, $repos, $input->getArgument('package'), $input->getArgument('version')); list($package, $versions) = $this->getPackage($installedRepo, $repos, $input->getArgument('package'), $input->getArgument('version'));
@ -214,6 +217,9 @@ EOT
// show tree view if requested // show tree view if requested
if ($input->getOption('tree')) { if ($input->getOption('tree')) {
if ('json' === $format) {
$io->writeError('Format "json" is only supported for package listings, falling back to format "text"');
}
$rootRequires = $this->getRootRequires(); $rootRequires = $this->getRootRequires();
foreach ($installedRepo->getPackages() as $package) { foreach ($installedRepo->getPackages() as $package) {
if (in_array($package->getName(), $rootRequires, true)) { if (in_array($package->getName(), $rootRequires, true)) {