gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnurl] 68/411: cmdline-opts/gen.pl: generate nicer "See Also" in curl.1


From: gnunet
Subject: [gnurl] 68/411: cmdline-opts/gen.pl: generate nicer "See Also" in curl.1
Date: Wed, 13 Jan 2021 01:18:03 +0100

This is an automated email from the git hooks/post-receive script.

nikita pushed a commit to branch master
in repository gnurl.

commit 401d237b859ae65f383a286c64f47b1c84be73fa
Author: Daniel Stenberg <daniel@haxx.se>
AuthorDate: Tue Sep 1 10:16:45 2020 +0200

    cmdline-opts/gen.pl: generate nicer "See Also" in curl.1
    
    If there are more than two items in the list, use commas for all but the
    last separator which is set to 'and'. Reads better.
    
    Closes #5898
---
 docs/cmdline-opts/gen.pl | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/docs/cmdline-opts/gen.pl b/docs/cmdline-opts/gen.pl
index b7a924e8a..0c434dac9 100755
--- a/docs/cmdline-opts/gen.pl
+++ b/docs/cmdline-opts/gen.pl
@@ -216,12 +216,24 @@ sub single {
     if($seealso) {
         my @m=split(/ /, $seealso);
         my $mstr;
+        my $and = 0;
+        my $num = scalar(@m);
+        if($num > 2) {
+            # use commas up to this point
+            $and = $num - 1;
+        }
+        my $i = 0;
         for my $k (@m) {
             if(!$helplong{$k}) {
                 print STDERR "WARN: $f see-alsos a non-existing option: $k\n";
             }
             my $l = manpageify($k);
-            $mstr .= sprintf "%s$l", $mstr?" and ":"";
+            my $sep = " and";
+            if($and && ($i < $and)) {
+                $sep = ",";
+            }
+            $mstr .= sprintf "%s$l", $mstr?"$sep ":"";
+            $i++;
         }
         push @foot, seealso($standalone, $mstr);
     }

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]