From: Daniel Stenberg Date: Wed, 5 Jun 2024 12:08:02 +0000 (+0200) Subject: managen: warn on excessively long help texts X-Git-Tag: curl-8_9_0~283 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b9c2a56be2980c1d2f6192006ac5d306bbb6858b;p=thirdparty%2Fcurl.git 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 --- 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;