summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2021-03-11 08:50:11 +0100
committerDaniel Stenberg <daniel@haxx.se>2021-03-11 08:50:11 +0100
commitfe40c264c0c440aaf37d78ba72b0fc00120d2ef0 (patch)
tree5ca02cf95fcc2adaf7f4f7328dad56e1709d8cb1
parent6043dfa4f9471cf4f5da2492670aff26b16a94ab (diff)
downloadcurl-fe40c264c0c440aaf37d78ba72b0fc00120d2ef0.tar.gz
gen.pl: quote "bare" minuses in the nroff output
Reported-by: Alejandro Colomar Fixes #6698
-rwxr-xr-xdocs/cmdline-opts/gen.pl6
1 files changed, 6 insertions, 0 deletions
diff --git a/docs/cmdline-opts/gen.pl b/docs/cmdline-opts/gen.pl
index 4bcedc36d..1fe4a92c9 100755
--- a/docs/cmdline-opts/gen.pl
+++ b/docs/cmdline-opts/gen.pl
@@ -70,6 +70,9 @@ sub printdesc {
$d =~ s/--$k([^a-z0-9_-])/$l$1/;
}
}
+ # quote "bare" minuses in the output
+ $d =~ s/( |\\fI|^)--/$1\\-\\-/g;
+ $d =~ s/([ -]|\\fI|^)-/$1\\-/g;
print $d;
}
}
@@ -203,6 +206,9 @@ sub single {
$opt .= " $arg";
}
+ # quote "bare" minuses in opt
+ $opt =~ s/( |^)--/$1\\-\\-/g;
+ $opt =~ s/( |^)-/$1\\-/g;
if($standalone) {
print ".TH curl 1 \"30 Nov 2016\" \"curl 7.52.0\" \"curl manual\"\n";
print ".SH OPTION\n";