aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xdoc/src/sgml/fixrtf26
1 files changed, 23 insertions, 3 deletions
diff --git a/doc/src/sgml/fixrtf b/doc/src/sgml/fixrtf
index a6a701f6db0..2c1172408c8 100755
--- a/doc/src/sgml/fixrtf
+++ b/doc/src/sgml/fixrtf
@@ -5,15 +5,35 @@
# M$Word does not care about it.
# (c) 2001, Thomas Lockhart, PostgreSQL Inc.
-flist=$@
+flist=""
+RPAT=""
+for i in $@ ; do
+ case "$i" in
+ -r|--refentry)
+ RPAT='-e s/\\\keepn/\\\keep/g'
+ ;;
+ -?|--help)
+ echo "$0 [--refentry] <rtf file> ..."
+ exit 0
+ ;;
+ -*)
+ echo "Command $i not recognized"
+ $0 --help
+ exit 1
+ ;;
+ *)
+ flist="$flist $i"
+ esac
+done
+
if [ "$flist" = "" ] ; then
flist=*.rtf
fi
for f in $flist ; do
- echo -n "Repairing $f..."
+ echo -n "Repairing '$f' ..."
if [ -r $f ] ; then
- (sed 's/{\\stylesheet{\\s1/{\\stylesheet{\\s0 Normal 0;}{\\s1/g' $f > $f.new \
+ (sed -e 's/{\\stylesheet{\\s1/{\\stylesheet{\\s0 Normal 0;}{\\s1/g' $RPAT $f > $f.new \
&& mv -f $f.new $f \
&& echo " done") || echo " failed"
else