5f4d8e9441
This PR was merged into the 2.7 branch.
Discussion
----------
[Console] Fix wrong handling of multiline arg/opt descriptions
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #20237, https://github.com/symfony/symfony/pull/13220#discussion_r84281248
| License | MIT
| Doc PR | N/A
### Before
<img width="1072" alt="screenshot 2016-11-30 a 19 23 17" src="https://cloud.githubusercontent.com/assets/2211145/20765428/8b622304-b732-11e6-911b-b169e9aed5fd.PNG">
### After
<img width="1074" alt="screenshot 2016-11-30 a 19 23 46" src="https://cloud.githubusercontent.com/assets/2211145/20765432/9159a53e-b732-11e6-909f-ec8107c78fed.PNG">
@rquadling and @leofeyer deserve the credit for reporting the issue and suggesting the proper fix. I've only executed it.
---
<details>
<summary>Show code to reproduce:</summary>
```php
<?php
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption;
require __DIR__.'/../vendor/autoload.php';
(new Application())
->add(new class extends Command {
protected function configure()
{
$description = "One of:" . array_reduce(['purge', 'truncate', 'delete', 'insert', 'select'], function ($value, $previous = '') {
return "$value\n- $previous";
});
$this
->setName('execute')
->addArgument('action', InputArgument::REQUIRED, $description)
->addOption('another-one', 'a', InputOption::VALUE_OPTIONAL, $description)
;
}
})
->getApplication()
->run(new ArgvInput())
;
```
</details>
Commits
-------
|
||
---|---|---|
.. | ||
Bridge | ||
Bundle | ||
Component |