#!/bin/sh

if test "$1" = -lv
then
	lock="-l$2"
	shift
	shift
elif test "$1" = -l
then
	lock="-l"
	shift
elif test "$1" = -rv
then
	lock="-r$2"
	shift
	shift
elif test "$1" = -r
then
	lock="-r"
	shift
fi

if test ! -d RCS
then
	echo apex_ci: Creating an RCS directory
	mkdir RCS
	echo done
fi
while read LINE
do
	if test "$LINE" = "."
	then
		break
	fi

	echo $LINE >> apex_ci_temp.$$
done

while test "$1" != ""
do
	ci -f $lock $1 < apex_ci_temp.$$
	shift
done

rm -f apex_ci_temp.$$
