ソースを参照

Add docs about new --format, refs #6228

Jordi Boggiano 8 年 前
コミット
a286c39f20
2 ファイル変更8 行追加3 行削除
  1. 6 3
      doc/03-cli.md
  2. 2 0
      src/Composer/Command/OutdatedCommand.php

+ 6 - 3
doc/03-cli.md

@@ -339,6 +339,7 @@ php composer.phar show monolog/monolog 1.0.2
 * **--outdated (-o):** Implies --latest, but this lists *only* packages that have a newer version available.
 * **--minor-only (-m):** Use with --latest. Only shows packages that have minor SemVer-compatible updates.
 * **--direct (-D):** Restricts the list of packages to your direct dependencies.
+* **--format (-f):** Lets you pick between text (default) or json output format.
 
 ## outdated
 
@@ -348,16 +349,18 @@ including their current and latest versions. This is basically an alias for
 
 The color coding is as such:
 
-- **green**: Dependency is in the latest version and is up to date.
-- **yellow**: Dependency has a new version available that includes backwards compatibility breaks according to semver, so upgrade when
+- **green (=)**: Dependency is in the latest version and is up to date.
+- **yellow (~)**: Dependency has a new version available that includes backwards compatibility breaks according to semver, so upgrade when
   you can but it may involve work.
-- **red**: Dependency has a new version that is semver-compatible and you should upgrade it.
+- **red (!)**: Dependency has a new version that is semver-compatible and you should upgrade it.
 
 ### Options
 
 * **--all (-a):** Show all packages, not just outdated (alias for `composer show -l`).
 * **--direct (-D):** Restricts the list of packages to your direct dependencies.
 * **--minor-only (-m):** Only shows packages that have minor SemVer-compatible updates.
+* **--strict:** Returns non-zero exit code if any package is outdated.
+* **--format (-f):** Lets you pick between text (default) or json output format.
 
 ## browse / home
 

+ 2 - 0
src/Composer/Command/OutdatedCommand.php

@@ -35,6 +35,7 @@ class OutdatedCommand extends ShowCommand
                 new InputOption('direct', 'D', InputOption::VALUE_NONE, 'Shows only packages that are directly required by the root package'),
                 new InputOption('strict', null, InputOption::VALUE_NONE, 'Return a non-zero exit code when there are outdated packages'),
                 new InputOption('minor-only', 'm', InputOption::VALUE_NONE, 'Show only packages that have minor SemVer-compatible updates. Use with the --outdated option.'),
+                new InputOption('format', 'f', InputOption::VALUE_REQUIRED, 'Format of the output: text or json', 'text'),
             ))
             ->setHelp(<<<EOT
 The outdated command is just a proxy for `composer show -l`
@@ -74,6 +75,7 @@ EOT
         if ($input->getOption('minor-only')) {
             $args['--minor-only'] = true;
         }
+        $args['--format'] = $input->getOption('format');
 
         $input = new ArrayInput($args);