From f6b7f0e29aa89b59d21479946ee28efb270bb551 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Thu, 30 May 2013 10:08:34 +0200 Subject: [PATCH] Add --lock argument to the update command to make this hack explicit and official --- doc/03-cli.md | 2 ++ src/Composer/Command/UpdateCommand.php | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/03-cli.md b/doc/03-cli.md index 3f1d6ae8b..e4f7f9083 100644 --- a/doc/03-cli.md +++ b/doc/03-cli.md @@ -124,6 +124,8 @@ You can also use wildcards to update a bunch of packages at once: * **--optimize-autoloader (-o):** Convert PSR-0 autoloading to classmap to get a faster autoloader. This is recommended especially for production, but can take a bit of time to run so it is currently not done by default. +* **--lock:** Only updates the lock file hash to suppress warning about the + lock file being out of date ## require diff --git a/src/Composer/Command/UpdateCommand.php b/src/Composer/Command/UpdateCommand.php index 2118465fd..0c5a49e33 100644 --- a/src/Composer/Command/UpdateCommand.php +++ b/src/Composer/Command/UpdateCommand.php @@ -35,6 +35,7 @@ class UpdateCommand extends Command new InputOption('dry-run', null, InputOption::VALUE_NONE, 'Outputs the operations but will not execute anything (implicitly enables --verbose).'), new InputOption('dev', null, InputOption::VALUE_NONE, 'Enables installation of require-dev packages (enabled by default, only present for sanity).'), new InputOption('no-dev', null, InputOption::VALUE_NONE, 'Disables installation of require-dev packages.'), + new InputOption('lock', null, InputOption::VALUE_NONE, 'Only updates the lock file hash to suppress warning about the lock file being out of date.'), new InputOption('no-custom-installers', null, InputOption::VALUE_NONE, 'Disables all custom installers.'), new InputOption('no-scripts', null, InputOption::VALUE_NONE, 'Skips the execution of all scripts defined in composer.json file.'), new InputOption('no-progress', null, InputOption::VALUE_NONE, 'Do not output download progress.'), @@ -92,7 +93,7 @@ EOT ->setRunScripts(!$input->getOption('no-scripts')) ->setOptimizeAutoloader($input->getOption('optimize-autoloader')) ->setUpdate(true) - ->setUpdateWhitelist($input->getArgument('packages')) + ->setUpdateWhitelist($input->getOption('lock') ? array('lock') : $input->getArgument('packages')) ; if ($input->getOption('no-custom-installers')) {