Add --all to oudated command and switch it to show only outdated by default, fixes #5253

main
Jordi Boggiano 8 years ago
parent 135783299a
commit fd5f90989f

@ -326,8 +326,9 @@ php composer.phar show monolog/monolog 1.0.2
## outdated ## outdated
The `outdated` command shows a list of installed packages including their The `outdated` command shows a list of installed packages that have updates available,
current and latest versions. This is basically an alias for `composer show -l`. including their current and latest versions. This is basically an alias for
`composer show -lo`.
The color coding is as such: The color coding is as such:
@ -338,7 +339,7 @@ The color coding is as such:
### Options ### Options
* **--outdated (-o):** Lists *only* packages that have a newer version available. * **--all (-a):** Show all packages, not just outdated (alias for `composer show -l`).
* **--direct (-D):** Restricts the list of packages to your direct dependencies. * **--direct (-D):** Restricts the list of packages to your direct dependencies.
## browse / home ## browse / home

@ -27,10 +27,11 @@ class OutdatedCommand extends ShowCommand
{ {
$this $this
->setName('outdated') ->setName('outdated')
->setDescription('Shows a list of installed packages including their latest version.') ->setDescription('Shows a list of installed packages that have updates available, including their latest version.')
->setDefinition(array( ->setDefinition(array(
new InputArgument('package', InputArgument::OPTIONAL, 'Package to inspect. Or a name including a wildcard (*) to filter lists of packages instead.'), new InputArgument('package', InputArgument::OPTIONAL, 'Package to inspect. Or a name including a wildcard (*) to filter lists of packages instead.'),
new InputOption('outdated', 'o', InputOption::VALUE_NONE, 'Show only packages that are outdated'), new InputOption('outdated', 'o', InputOption::VALUE_NONE, 'Show only packages that are outdated (this is the default, but present here for compat with `show`'),
new InputOption('all', 'a', InputOption::VALUE_NONE, 'Show all installed packages with their latest versions'),
new InputOption('direct', 'D', InputOption::VALUE_NONE, 'Shows only packages that are directly required by the root package'), new InputOption('direct', 'D', InputOption::VALUE_NONE, 'Shows only packages that are directly required by the root package'),
)) ))
->setHelp(<<<EOT ->setHelp(<<<EOT
@ -56,7 +57,7 @@ EOT
'show', 'show',
'--latest' => true, '--latest' => true,
); );
if ($input->getOption('outdated')) { if (!$input->getOption('all')) {
$args['--outdated'] = true; $args['--outdated'] = true;
} }
if ($input->getOption('direct')) { if ($input->getOption('direct')) {

Loading…
Cancel
Save