From 4abaaaf76d664a0f745f33cf6551e6555b354977 Mon Sep 17 00:00:00 2001 From: Haralan Dobrev Date: Sat, 21 Sep 2013 02:10:24 +0300 Subject: [PATCH] Use default description and license from CLI args When running `composer init` with `--description` and `--license` arguments on the command line they are later suggested as defaults during the interactive flow. However when you press Enter (to use the default suggesstion) Composer does not use it, but instead skip them entirely from the `composer.json` generation. This change provides a default argument not only to `DialogHelper::getQuestion()`, but also to `DialogHelper::ask()`. --- src/Composer/Command/InitCommand.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Composer/Command/InitCommand.php b/src/Composer/Command/InitCommand.php index 1071e949d..a44546b73 100644 --- a/src/Composer/Command/InitCommand.php +++ b/src/Composer/Command/InitCommand.php @@ -208,7 +208,8 @@ EOT $description = $input->getOption('description') ?: false; $description = $dialog->ask( $output, - $dialog->getQuestion('Description', $description) + $dialog->getQuestion('Description', $description), + $description ); $input->setOption('description', $description); @@ -258,7 +259,8 @@ EOT $license = $input->getOption('license') ?: false; $license = $dialog->ask( $output, - $dialog->getQuestion('License', $license) + $dialog->getQuestion('License', $license), + $license ); $input->setOption('license', $license);