A perl script that does appropriate backslash escaping of '-' chars
authorWayne Davison <wayned@samba.org>
Tue, 24 Oct 2006 00:09:18 +0000 (00:09 +0000)
committerWayne Davison <wayned@samba.org>
Tue, 24 Oct 2006 00:09:18 +0000 (00:09 +0000)
in manpages.

tweak_manpage [new file with mode: 0755]

diff --git a/tweak_manpage b/tweak_manpage
new file mode 100755 (executable)
index 0000000..1efac26
--- /dev/null
@@ -0,0 +1,9 @@
+#!/usr/bin/perl -i -p
+s{(--\w[-\w]+)}{ $x = $1; $x =~ s/-/\\-/g; $x }eg;
+s/(?<!\\)-(['"\d*])/\\-$1/g;
+s/ -- / \\-\\- /g;
+s#(['"(= /,])-#$1\\-#g;
+s/(\\fB)-/$1\\-/g;
+s/(\[\w)-(\w\])/$1\\-$2/g;
+s{(\\f\(CW.*?\\fP)}{ $x = $1; $x =~ s/(?<!\\)-/\\-/g; $x }eg;
+s/(\.\w+)-/$1\\-/g;