#!/bin/csh -f
#
# This program adds a symbolic name to all files in the RCS
# directory.
#
# Usage: addrcsname NAME [files]
#

set whoami = $0
set whoami = $whoami:t

if ($#argv < 1) then
   echo "Usage: $whoami NAME [files]"
   exit 1
endif

set name=$1
shift

if ($#argv) then
   set files="$*"
else
   set files="RCS/*,v"
endif

echo "Processing these files:"
foreach filename ($files)
   echo "   $filename"
end

foreach filename ($files)
   echo "Checking in file " $filename "..."
   set rev=`rlog -h $filename|sed -n '/^head:/s/^head:[^0-9]*\([0-9]*\.[0-9]*\)$/\1/p'`
   rcs -N$name":"$rev $filename
   echo "Done processing " $filename "..."
end

echo "Done."
exit 0
