managen: fix each options footer to end with newline

A previous change sometimes made a command line option's description not
end with a newline immediately before the next command line.

Also widened the lines to wrap on column 79 instead of 78.

Closes #14010
This commit is contained in:
Daniel Stenberg 2024-06-25 11:35:48 +02:00
parent ad3e476275
commit 8e3e3921e6
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -59,6 +59,8 @@ my $year = strftime "%Y", @ts;
my $version = "unknown";
my $globals;
my $indent = 4;
# get the long name version, return the man page string
sub manpageify {
my ($k)=@_;
@ -85,13 +87,13 @@ sub manpageify {
}
my $colwidth=78; # max number of columns
my $colwidth=79; # max number of columns
sub justline {
my ($lvl, @line) = @_;
my $w = -1;
my $spaces = -1;
my $width = $colwidth - ($lvl * 4);
my $width = $colwidth - ($lvl * $indent);
for(@line) {
$w += length($_);
$w++;
@ -103,7 +105,7 @@ sub justline {
$ratio = $inject / $spaces;
}
my $spare = 0;
print ' ' x ($lvl * 4);
print ' ' x ($lvl * $indent);
my $prev;
for(@line) {
while($spare >= 0.90) {
@ -119,7 +121,7 @@ sub justline {
sub lastline {
my ($lvl, @line) = @_;
print ' ' x ($lvl * 4);
print ' ' x ($lvl * $indent);
my $prev = 0;
for(@line) {
printf "%s%s", $prev?" ":"", $_;
@ -134,7 +136,7 @@ sub outputpara {
my $w = 0;
my @words = split(/ */, $f);
my $width = $colwidth - ($lvl * 4);
my $width = $colwidth - ($lvl * $indent);
my @line;
for my $e (@words) {
@ -203,7 +205,7 @@ sub seealso {
".SH \"SEE ALSO\"\n$data\n";
}
else {
return "\nSee also $data. ";
return "See also $data. ";
}
}
@ -255,7 +257,7 @@ sub added {
return ".SH \"ADDED\"\nAdded in curl version $data\n";
}
else {
return "\nAdded in $data.";
return "Added in $data. ";
}
}
@ -773,16 +775,15 @@ sub single {
push @foot, added($standalone, $added);
}
push @foot, seealso($standalone, $mstr);
if($foot[0]) {
print "\n";
my $f = join("", @foot);
if($manpage) {
$f =~ s/ +\z//; # remove trailing space
print "$f\n";
}
else {
printdesc($manpage, 2, "[1]$f");
}
print "\n";
my $f = join("", @foot);
if($manpage) {
$f =~ s/ +\z//; # remove trailing space
print "$f\n";
}
else {
printdesc($manpage, 2, "[1]$f");
}
return 0;
}