@ -52,7 +52,7 @@ class ShowCommand extends BaseCommand
->setDefinition(array(
->setDefinition(array(
new InputArgument('package', InputArgument::OPTIONAL, 'Package to inspect'),
new InputArgument('package', InputArgument::OPTIONAL, 'Package to inspect'),
new InputArgument('version', InputArgument::OPTIONAL, 'Version or version constraint to inspect'),
new InputArgument('version', InputArgument::OPTIONAL, 'Version or version constraint to inspect'),
new InputOption('installed', 'i', InputOption::VALUE_NONE, 'List installed packages only'),
new InputOption('all', null, InputOption::VALUE_NONE, 'List all packages'),
new InputOption('platform', 'p', InputOption::VALUE_NONE, 'List platform packages only'),
new InputOption('platform', 'p', InputOption::VALUE_NONE, 'List platform packages only'),
new InputOption('available', 'a', InputOption::VALUE_NONE, 'List available packages only'),
new InputOption('available', 'a', InputOption::VALUE_NONE, 'List available packages only'),
new InputOption('self', 's', InputOption::VALUE_NONE, 'Show the root package information'),
new InputOption('self', 's', InputOption::VALUE_NONE, 'Show the root package information'),
@ -79,9 +79,9 @@ EOT
$composer = $this->getComposer(false);
$composer = $this->getComposer(false);
$io = $this->getIO();
$io = $this->getIO();
if ($input->getOption('tree') &&!$input->getOption('installed')) {
if ($input->getOption('tree') &&($input->getOption('all') || $input->getOption('available'))) {
$io->writeError('The --tree (-t) option is only usable in combination with --installed (-i) or by passing a single package name to show, assuming -i');
$io->writeError('The --tree (-t) option is not usable in combination with --all or --available (-a)');
$input->setOption('installed', true);
return;
}
}
// init repos
// init repos
@ -96,8 +96,6 @@ EOT
$repos = $installedRepo = new ArrayRepository(array($package));
$repos = $installedRepo = new ArrayRepository(array($package));