mirror of
https://github.com/curl/curl.git
synced 2026-06-24 09:15:40 +03:00
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:
parent
72abf7c13a
commit
b9c2a56be2
1 changed files with 7 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue