diff --git a/src/Composer/Command/InitCommand.php b/src/Composer/Command/InitCommand.php
index 94ac109fc..e43e801e5 100644
--- a/src/Composer/Command/InitCommand.php
+++ b/src/Composer/Command/InitCommand.php
@@ -299,16 +299,18 @@ EOT
$io->writeError(array('', 'Define your dependencies.', ''));
$question = 'Would you like to define your dependencies (require) interactively [yes]? ';
+ $require = $input->getOption('require');
$requirements = array();
- if ($io->askConfirmation($question, true)) {
- $requirements = $this->determineRequirements($input, $output, $input->getOption('require'));
+ if ($require || $io->askConfirmation($question, true)) {
+ $requirements = $this->determineRequirements($input, $output, $require);
}
$input->setOption('require', $requirements);
$question = 'Would you like to define your dev dependencies (require-dev) interactively [yes]? ';
+ $requireDev = $input->getOption('require-dev');
$devRequirements = array();
- if ($io->askConfirmation($question, true)) {
- $devRequirements = $this->determineRequirements($input, $output, $input->getOption('require-dev'));
+ if ($requireDev || $io->askConfirmation($question, true)) {
+ $devRequirements = $this->determineRequirements($input, $output, $requireDev);
}
$input->setOption('require-dev', $devRequirements);
}