From 18086aa5e77cbce8483826691a1dc97426f9c167 Mon Sep 17 00:00:00 2001 From: Ismael Ambrosi Date: Wed, 10 Oct 2012 09:42:57 -0200 Subject: [PATCH] Added option to display dev-required packages --- src/Composer/Command/ShowCommand.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/Composer/Command/ShowCommand.php b/src/Composer/Command/ShowCommand.php index 7451e0a16..48ecef8ad 100644 --- a/src/Composer/Command/ShowCommand.php +++ b/src/Composer/Command/ShowCommand.php @@ -42,6 +42,7 @@ class ShowCommand extends Command new InputOption('installed', 'i', InputOption::VALUE_NONE, 'List installed packages only'), new InputOption('platform', 'p', InputOption::VALUE_NONE, 'List platform packages only'), new InputOption('self', 's', InputOption::VALUE_NONE, 'Show the root package information'), + new InputOption('dev', null, InputOption::VALUE_NONE, 'Enables display of dev-require packages.'), )) ->setHelp(<<getRepositoryManager(); + $repos = new CompositeRepository(array($manager->getLocalRepository())); + if ($dev) { + $repos->addRepository($manager->getLocalDevRepository()); + } + + return $repos; + }; + if ($input->getOption('self')) { $package = $this->getComposer(false)->getPackage(); $repos = $installedRepo = new ArrayRepository(array($package)); } elseif ($input->getOption('platform')) { $repos = $installedRepo = $platformRepo; } elseif ($input->getOption('installed')) { - $composer = $this->getComposer(); - $repos = $installedRepo = $composer->getRepositoryManager()->getLocalRepository(); + $repos = $installedRepo = $getRepositories($this->getComposer(), $input->getOption('dev')); } elseif ($composer = $this->getComposer(false)) { - $localRepo = $composer->getRepositoryManager()->getLocalRepository(); + $localRepo = $getRepositories($composer, $input->getOption('dev')); $installedRepo = new CompositeRepository(array($localRepo, $platformRepo)); $repos = new CompositeRepository(array_merge(array($installedRepo), $composer->getRepositoryManager()->getRepositories())); } else {