A perl script that does appropriate backslash escaping of '-' chars

in manpages.
This commit is contained in:
Wayne Davison committed 2006-10-24 00:09:18 +00:00
1 parent f964ac5eee
commit 5e61bdb4d5
1 file changed
+9
Executable
+9
View File
@@ -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;