Refer to the right sorted/unsorted file list array in touch_up_dirs().
[rsync/rsync.git] / tweak_manpage
CommitLineData
5e61bdb4 1#!/usr/bin/perl -i -p
39411fa8
WD
2
3# Make some hyphens unbreakable.
5e61bdb4
WD
4s{(--\w[-\w]+)}{ $x = $1; $x =~ s/-/\\-/g; $x }eg;
5s/(?<!\\)-(['"\d*])/\\-$1/g;
b6855ddc 6s#(['"(= /,])-(?!-)#$1\\-#g;
5e61bdb4
WD
7s/(\\fB)-/$1\\-/g;
8s/(\[\w)-(\w\])/$1\\-$2/g;
9s{(\\f\(CW.*?\\fP)}{ $x = $1; $x =~ s/(?<!\\)-/\\-/g; $x }eg;
10s/(\.\w+)-/$1\\-/g;
39411fa8
WD
11
12# We only need to use "\&'" or "\&." at the start of a line.
13s/(?<=.)\\\&(['.])/$1$2/g;
14
15# Use an em-dash where appropriate.
16s/ \\?-{1,2} / \\(em /g;
17
18# Some quotes turn into open/close quotes.
19s/'(.)'/\\(oq$1\\(cq/g;
20s/(^|[ (])"(?!( |$))/$1\\(lq/gm;
21s/(?<! )"([.,:;! )]|$)/\\(rq$1/gm;
22s/(\\\(lq[^(]*) "( |$)/$1 \\(rq$2/gm;
23s/(^| )" ([^(]*\\\(rq)/$1\\(lq $2/gm;
24
25# And some don't.
26s/^([. ])(.*)/ $1 . realquotes($2) /egm;
27s/(\\f(B|\(CW).*?\\fP)/ realquotes($1) /egs;
28
29s/^\\\&(\\\(oq)/$1/gm;
30
31sub realquotes
32{
33 my($txt) = @_;
34 $txt =~ s/\\\([lr]q/"/g;
35 $txt =~ s/\\\([oc]q/'/g;
36 $txt;
37}