From a286c39f2037b0a16bf4a3b18ff4eca7a1f371a1 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Tue, 7 Mar 2017 14:19:51 +0100 Subject: [PATCH] Add docs about new --format, refs #6228 --- doc/03-cli.md | 9 ++++++--- src/Composer/Command/OutdatedCommand.php | 2 ++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/doc/03-cli.md b/doc/03-cli.md index 615e5cc86..4fcf42ed6 100644 --- a/doc/03-cli.md +++ b/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 diff --git a/src/Composer/Command/OutdatedCommand.php b/src/Composer/Command/OutdatedCommand.php index 80a574455..f356a75b2 100644 --- a/src/Composer/Command/OutdatedCommand.php +++ b/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(<<getOption('minor-only')) { $args['--minor-only'] = true; } + $args['--format'] = $input->getOption('format'); $input = new ArrayInput($args);