From 4cc45d3c377790e91fc3a20fdd3d1ac4a9227f6b Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Tue, 17 Apr 2012 10:32:35 +0200 Subject: [PATCH] Add require-dev and other missing links in show command --- src/Composer/Command/ShowCommand.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/Composer/Command/ShowCommand.php b/src/Composer/Command/ShowCommand.php index f2f766f06..4c6372f5d 100644 --- a/src/Composer/Command/ShowCommand.php +++ b/src/Composer/Command/ShowCommand.php @@ -78,7 +78,15 @@ EOT $this->printMeta($input, $output, $package, $installedRepo, $repos); $this->printLinks($input, $output, $package, 'requires'); - $this->printLinks($input, $output, $package, 'devRequires'); + $this->printLinks($input, $output, $package, 'devRequires', 'requires (dev)'); + if ($package->getSuggests()) { + $output->writeln("\nsuggests"); + foreach ($package->getSuggests() as $suggested => $reason) { + $output->writeln($suggested . ' ' . $reason . ''); + } + } + $this->printLinks($input, $output, $package, 'provides'); + $this->printLinks($input, $output, $package, 'conflicts'); $this->printLinks($input, $output, $package, 'replaces'); return; } @@ -209,10 +217,11 @@ EOT * * @param string $linkType */ - protected function printLinks(InputInterface $input, OutputInterface $output, PackageInterface $package, $linkType) + protected function printLinks(InputInterface $input, OutputInterface $output, PackageInterface $package, $linkType, $title = null) { + $title = $title ?: $linkType; if ($links = $package->{'get'.ucfirst($linkType)}()) { - $output->writeln("\n" . $linkType . ""); + $output->writeln("\n" . $title . ""); foreach ($links as $link) { $output->writeln($link->getTarget() . ' ' . $link->getPrettyConstraint() . '');