From 8cb0976c5b910578d14510dcabf59db6fb146c3e Mon Sep 17 00:00:00 2001 From: Yonas Habteab Date: Fri, 21 Oct 2022 16:41:37 +0200 Subject: [PATCH] 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. --- library/Icinga/Cli/Documentation/CommentParser.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/library/Icinga/Cli/Documentation/CommentParser.php b/library/Icinga/Cli/Documentation/CommentParser.php index 3d56e17d6..410484897 100644 --- a/library/Icinga/Cli/Documentation/CommentParser.php +++ b/library/Icinga/Cli/Documentation/CommentParser.php @@ -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;