]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
gen: escape more minus
authorDaniel Stenberg <daniel@haxx.se>
Fri, 11 Aug 2023 15:01:34 +0000 (17:01 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 11 Aug 2023 18:51:00 +0000 (20:51 +0200)
Detected since it was still hard to search for option names using dashes
in the middle in the man page.

Closes #11660

docs/cmdline-opts/gen.pl

index e11e5f06d0434bb743dd9e074570e7fc325c6d5c..c6517e7ea6608fb366d3d809dbe2628df51b3f11 100755 (executable)
@@ -66,13 +66,16 @@ close(INC);
 sub manpageify {
     my ($k)=@_;
     my $l;
+    my $klong = $k;
+    # quote "bare" minuses in the long name
+    $klong =~ s/-/\\-/g;
     if($optlong{$k} ne "") {
         # both short + long
-        $l = "\\fI-".$optlong{$k}.", \\-\\-$k\\fP";
+        $l = "\\fI-".$optlong{$k}.", \\-\\-$klong\\fP";
     }
     else {
         # only long
-        $l = "\\fI\\-\\-$k\\fP";
+        $l = "\\fI\\-\\-$klong\\fP";
     }
     return $l;
 }
@@ -315,6 +318,9 @@ sub single {
     }
     close(F);
     my $opt;
+
+    # escape minus
+    $long =~ s/-/\\-/g;
     if(defined($short) && $long) {
         $opt = "-$short, --$long";
     }