]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
managen: cleanups to generate nicer-looking output
authorDaniel Stenberg <daniel@haxx.se>
Mon, 24 Jun 2024 08:53:29 +0000 (10:53 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 24 Jun 2024 11:17:19 +0000 (13:17 +0200)
- 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

index a231afd94ec047cf100c788d614f5a7e71e733da..e4adcee147258dc9918b1ffa58a609778232bbb4 100755 (executable)
@@ -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);