From aa83d77271f0d2be72067058f78abd1780f3b69e Mon Sep 17 00:00:00 2001 From: wkj Date: Mon, 17 May 2004 03:22:35 +0000 Subject: More troff bits; if you want them elsewhere, feel free to repo copy them. --- bin/tref | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100755 bin/tref (limited to 'bin/tref') diff --git a/bin/tref b/bin/tref new file mode 100755 index 00000000..d06e9a05 --- /dev/null +++ b/bin/tref @@ -0,0 +1,31 @@ +awk ' +BEGIN{ + print ".nr Rp 1" # supress ... Rx lines + first=1 +} + +#these come first +$1=="..." && $2=="Rx"{ + ref[$4] = $3 + next +} + +first { + printf(".lf %d %s\n", 1, inputfile) + lineoffset=NR-1 + first=0 +} + +$1==".Rf"{ + if($2 in ref) + $2=ref[$2] + else + printf("tref: %s:%d: no ref for %s\n", + inputfile, NR-lineoffset, $2) >"/dev/stderr" +} + +{ + print +} + +' $* -- cgit v1.2.3