mirror of
https://github.com/composer/composer
synced 2025-05-10 09:02:59 +00:00
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()`.
This commit is contained in:
parent
da7ace02eb
commit
4abaaaf76d
1 changed files with 4 additions and 2 deletions
|
@ -208,7 +208,8 @@ EOT
|
||||||
$description = $input->getOption('description') ?: false;
|
$description = $input->getOption('description') ?: false;
|
||||||
$description = $dialog->ask(
|
$description = $dialog->ask(
|
||||||
$output,
|
$output,
|
||||||
$dialog->getQuestion('Description', $description)
|
$dialog->getQuestion('Description', $description),
|
||||||
|
$description
|
||||||
);
|
);
|
||||||
$input->setOption('description', $description);
|
$input->setOption('description', $description);
|
||||||
|
|
||||||
|
@ -258,7 +259,8 @@ EOT
|
||||||
$license = $input->getOption('license') ?: false;
|
$license = $input->getOption('license') ?: false;
|
||||||
$license = $dialog->ask(
|
$license = $dialog->ask(
|
||||||
$output,
|
$output,
|
||||||
$dialog->getQuestion('License', $license)
|
$dialog->getQuestion('License', $license),
|
||||||
|
$license
|
||||||
);
|
);
|
||||||
$input->setOption('license', $license);
|
$input->setOption('license', $license);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue