Bladeren bron

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

Jordi Boggiano 9 jaren geleden
bovenliggende
commit
fd5f90989f
2 gewijzigde bestanden met toevoegingen van 8 en 6 verwijderingen
  1. 4 3
      doc/03-cli.md
  2. 4 3
      src/Composer/Command/OutdatedCommand.php

+ 4 - 3
doc/03-cli.md

@@ -326,8 +326,9 @@ php composer.phar show monolog/monolog 1.0.2
 
 ## outdated
 
-The `outdated` command shows a list of installed packages including their
-current and latest versions. This is basically an alias for `composer show -l`.
+The `outdated` command shows a list of installed packages that have updates available,
+including their current and latest versions. This is basically an alias for
+`composer show -lo`.
 
 The color coding is as such:
 
@@ -338,7 +339,7 @@ The color coding is as such:
 
 ### 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.
 
 ## browse / home

+ 4 - 3
src/Composer/Command/OutdatedCommand.php

@@ -27,10 +27,11 @@ class OutdatedCommand extends ShowCommand
     {
         $this
             ->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(
                 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'),
             ))
             ->setHelp(<<<EOT
@@ -56,7 +57,7 @@ EOT
             'show',
             '--latest' => true,
         );
-        if ($input->getOption('outdated')) {
+        if (!$input->getOption('all')) {
             $args['--outdated'] = true;
         }
         if ($input->getOption('direct')) {