From 1c9250c46d2e7897251f3c7336477dba2944f092 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 24 Jun 2024 10:53:29 +0200 Subject: [PATCH] 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 --- scripts/managen | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/scripts/managen b/scripts/managen index a231afd94e..e4adcee147 100755 --- a/scripts/managen +++ b/scripts/managen @@ -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);