#!/bin/sh
#
# improve index source data and generate the index

echo "improve-index.sh"
echo "@: $@"

if [ $# -eq 0 ] ; then
	echo "usage: $0 <idxinput> ..."
	exit 1
fi

for i in "$@" ; do
	echo "processing $i.idx"
	mv "$i.idx" "$i.unprocessed.idx"
	<"$i.unprocessed.idx" `dirname $0`/improve-index.awk >"$i.idx"
done

makeindex "$@"
