CommentParser: Wrap descriptions after the available screen columns

Well, what should I say, the PHP code sniffer allows us up to 120 characters
line length and when you code/format based on these rules, e.g the description
of a cli command, it will mess everything up when you run `icingacli module --help`.
So, we can just wrap the output after the available screen columns.
This commit is contained in:
Yonas Habteab 2022-10-21 16:41:37 +02:00 committed by Johannes Meyer
parent bb4b53e90c
commit 8cb0976c5b
1 changed files with 3 additions and 1 deletions

View File

@ -3,6 +3,8 @@
namespace Icinga\Cli\Documentation;
use Icinga\Cli\Screen;
class CommentParser
{
protected $raw;
@ -75,7 +77,7 @@ class CommentParser
}
foreach ($this->paragraphs as $p) {
$res .= wordwrap($p, 72) . "\n\n";
$res .= wordwrap($p, Screen::instance()->getColumns()) . "\n\n";
}
return $res;