gen: escape more minus

Detected since it was still hard to search for option names using dashes
in the middle in the man page.

Closes #11660
This commit is contained in:
Daniel Stenberg 2023-08-11 17:01:34 +02:00
parent 00ac47bfaa
commit 439ff2052e
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

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