From a2b227740adcbe5e45026e88a0e1a512caae811c Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Wed, 9 Apr 2014 20:08:10 -0700 Subject: [PATCH] Add an --update-no-dev option to the require command --- src/Composer/Command/RequireCommand.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Composer/Command/RequireCommand.php b/src/Composer/Command/RequireCommand.php index 4a005d809..fa327a00e 100644 --- a/src/Composer/Command/RequireCommand.php +++ b/src/Composer/Command/RequireCommand.php @@ -42,6 +42,7 @@ class RequireCommand extends InitCommand new InputOption('prefer-dist', null, InputOption::VALUE_NONE, 'Forces installation from package dist even for dev versions.'), new InputOption('no-progress', null, InputOption::VALUE_NONE, 'Do not output download progress.'), new InputOption('no-update', null, InputOption::VALUE_NONE, 'Disables the automatic update of the dependencies.'), + new InputOption('update-no-dev', null, InputOption::VALUE_NONE, 'Run the dependency update with the --no-dev option.'), new InputOption('update-with-dependencies', null, InputOption::VALUE_NONE, 'Allows inherited dependencies to be updated with explicit dependencies.'), )) ->setHelp(<<getOption('no-update')) { return 0; } + $updateDevMode = $input->getOption('update-no-dev') ? false : true; // Update packages $composer = $this->getComposer(); @@ -119,7 +121,7 @@ EOT ->setVerbose($input->getOption('verbose')) ->setPreferSource($input->getOption('prefer-source')) ->setPreferDist($input->getOption('prefer-dist')) - ->setDevMode(true) + ->setDevMode($updateDevMode) ->setUpdate(true) ->setUpdateWhitelist(array_keys($requirements)) ->setWhitelistDependencies($input->getOption('update-with-dependencies'));