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
This commit is contained in:
Daniel Stenberg 2024-06-05 14:08:02 +02:00
parent 72abf7c13a
commit b9c2a56be2
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -783,7 +783,9 @@ sub getshortlong {
my $protocols;
my $category;
my $start = 0;
my $line = 0;
while(<F>) {
$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;