blob: c2c4afbf45912096af20f10a333b7aaee559b7ae (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
#!/usr/bin/perl -p
# list -- escape code listing for troff
use Getopt::Std;
BEGIN { getopt('Ep:s:') }
if (/^\.\s*l\(\s*$/ .. /^\.\s*l\)\s*$/) {
not $opt_E and s/^\\!// and next;
if (/^\.\s*l\(\s*$/) {
$_ = '';
$_ = "$opt_p\n" if $opt_p;
} elsif (/^\.\s*l\)\s*$/) {
$_ = '';
$_ = "$opt_s\n" if $opt_s;
} else {
s/\\/\\$&/g;
s/^/\\&/g;
s/'/\\(aq/g;
s/\`/\\(ga/g;
}
}
|