diff options
author | Patrick Monnerat <patrick@monnerat.net> | 2022-10-31 04:23:59 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2022-11-01 12:00:39 +0100 |
commit | 3b9af11c77d63257bada499f1d164542eda02e80 (patch) | |
tree | 378727a73bbe8037839ec37a625eb7ff229562b3 /docs | |
parent | 65bdd6baec664c3d22260a43c8f633f30d238f50 (diff) | |
download | curl-3b9af11c77d63257bada499f1d164542eda02e80.tar.gz |
gen.pl: do not generate CURLHELP bitmask lines > 79 characters
If a command line option is in many help categories, there is a risk
that CURLHELP bitmask source lines generated for listhelp are longer
than 79 characters.
This change takes care of folding such long lines.
Cloes #9834
Diffstat (limited to 'docs')
-rwxr-xr-x | docs/cmdline-opts/gen.pl | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/docs/cmdline-opts/gen.pl b/docs/cmdline-opts/gen.pl index fe3e43e06..d34e90513 100755 --- a/docs/cmdline-opts/gen.pl +++ b/docs/cmdline-opts/gen.pl @@ -540,7 +540,7 @@ HEAD my $long = $f; my $short = $optlong{$long}; my @categories = split ' ', $catlong{$long}; - my $bitmask; + my $bitmask = ' '; my $opt; if(defined($short) && $long) { @@ -556,6 +556,7 @@ HEAD $bitmask .= ' | '; } } + $bitmask =~ s/(?=.{76}).{1,76}\|/$&\n /g; my $arg = $arglong{$long}; if($arg) { $opt .= " $arg"; @@ -563,7 +564,7 @@ HEAD my $desc = $helplong{$f}; $desc =~ s/\"/\\\"/g; # escape double quotes - my $line = sprintf " {\"%s\",\n \"%s\",\n %s},\n", $opt, $desc, $bitmask; + my $line = sprintf " {\"%s\",\n \"%s\",\n %s},\n", $opt, $desc, $bitmask; if(length($opt) > 78) { print STDERR "WARN: the --$long name is too long\n"; |