From b9c2a56be2980c1d2f6192006ac5d306bbb6858b Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 5 Jun 2024 14:08:02 +0200 Subject: [PATCH] managen: warn on excessively long help texts Help texts at 49 characters or longer get a warning displayed because they make --help output uglier and we should make an effort to keep the help texts short and succinct. The warning is only for display, it does not break the build. That is left for the future if necessary. I picked 49 because the longest current text is 48. Closes #13895 --- scripts/managen | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/managen b/scripts/managen index 8f16783982..a231afd94e 100755 --- a/scripts/managen +++ b/scripts/managen @@ -783,7 +783,9 @@ sub getshortlong { my $protocols; my $category; my $start = 0; + my $line = 0; while() { + $line++; if(!$start) { if(/^---/) { $start = 1; @@ -798,6 +800,11 @@ sub getshortlong { } elsif(/^Help: (.*)/i) { $help=$1; + my $len = length($help); + if($len >= 49) { + printf STDERR "$f:$line:1:WARN: oversized help text: %d characters\n", + $len; + } } elsif(/^Arg: (.*)/i) { $arg=$1; -- 2.47.3