mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-27 15:54:03 +02:00
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. (cherry picked from commit 8cb0976c5b910578d14510dcabf59db6fb146c3e)
This commit is contained in:
parent
12aace9af0
commit
aa7767e0f5
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user