A perl script that does appropriate backslash escaping of '-' chars
[rsync/rsync.git] / tweak_manpage
1 #!/usr/bin/perl -i -p
2 s{(--\w[-\w]+)}{ $x = $1; $x =~ s/-/\\-/g; $x }eg;
3 s/(?<!\\)-(['"\d*])/\\-$1/g;
4 s/ -- / \\-\\- /g;
5 s#(['"(= /,])-#$1\\-#g;
6 s/(\\fB)-/$1\\-/g;
7 s/(\[\w)-(\w\])/$1\\-$2/g;
8 s{(\\f\(CW.*?\\fP)}{ $x = $1; $x =~ s/(?<!\\)-/\\-/g; $x }eg;
9 s/(\.\w+)-/$1\\-/g;