mirror of
https://github.com/curl/curl.git
synced 2024-11-27 05:50:21 +08:00
managen: cleanups to generate nicer-looking output
- output "see also" last - when there are multiple mutex items, use commas between all of them except the last. - call them mututally exclusive WITH not TO other options. - remove trailing space from added in, add newline prefix - smoother language for requires Closes #14001
This commit is contained in:
parent
76e0196b1e
commit
1c9250c46d
@ -203,7 +203,7 @@ sub seealso {
|
||||
".SH \"SEE ALSO\"\n$data\n";
|
||||
}
|
||||
else {
|
||||
return "See also $data. ";
|
||||
return "\nSee also $data. ";
|
||||
}
|
||||
}
|
||||
|
||||
@ -255,7 +255,7 @@ sub added {
|
||||
return ".SH \"ADDED\"\nAdded in curl version $data\n";
|
||||
}
|
||||
else {
|
||||
return "Added in $data. ";
|
||||
return "\nAdded in $data.";
|
||||
}
|
||||
}
|
||||
|
||||
@ -710,25 +710,31 @@ sub single {
|
||||
$mstr .= sprintf "%s$l", $mstr?"$sep ":"";
|
||||
$i++;
|
||||
}
|
||||
push @foot, seealso($standalone, $mstr);
|
||||
|
||||
if($requires) {
|
||||
my $l = $manpage ? manpageify($long) : "--$long";
|
||||
push @foot, "$l requires that the underlying libcurl".
|
||||
" was built to support $requires. ";
|
||||
push @foot, "$l requires that libcurl".
|
||||
" is built to support $requires.\n";
|
||||
}
|
||||
if($mutexed) {
|
||||
my @m=split(/ /, $mutexed);
|
||||
my $mstr;
|
||||
my $num = scalar(@m);
|
||||
my $count;
|
||||
for my $k (@m) {
|
||||
if(!$helplong{$k}) {
|
||||
print STDERR "WARN: $f mutexes a non-existing option: $k\n";
|
||||
}
|
||||
my $l = $manpage ? manpageify($k) : "--$k";
|
||||
$mstr .= sprintf "%s$l", $mstr?" and ":"";
|
||||
my $sep = ", ";
|
||||
if($count == ($num -1)) {
|
||||
$sep = " and ";
|
||||
}
|
||||
$mstr .= sprintf "%s$l", $mstr?$sep:"";
|
||||
$count++;
|
||||
}
|
||||
push @foot, overrides($standalone,
|
||||
"This option is mutually exclusive to $mstr. ");
|
||||
"This option is mutually exclusive with $mstr.\n");
|
||||
}
|
||||
if($examples[0]) {
|
||||
my $s ="";
|
||||
@ -757,6 +763,7 @@ sub single {
|
||||
if($added) {
|
||||
push @foot, added($standalone, $added);
|
||||
}
|
||||
push @foot, seealso($standalone, $mstr);
|
||||
if($foot[0]) {
|
||||
print "\n";
|
||||
my $f = join("", @foot);
|
||||
|
Loading…
Reference in New Issue
Block a user