#!/bin/sh
##	@(#)$Revision: 1.16.109.1 $	$Date: 91/11/19 13:57:32 $
#	sdiff	--	front end for sccsdiff
##
#	determines the current working directory relative to the
#	development environment /nfs/develop/$LOGNAME, and prepends that
#	and the SCCS path name onto the names of the files, similar to
#	how in/out/unout function.  Then determines the latest revision
#	of the files specified, and does an sccsdiff for each of them.
#	A lot of hassles for relatively simple functionality ...
##
NAME=`basename $0`

if [ $# -eq 0 ] ; then
	echo	"Usage: $NAME file [files...]" ; exit 1
fi

DEVELOP="$Nfs/develop/[^/]*"
CWD=`pwd|sed -e "s,$DEVELOP/,,"`
SCCS="$Nfs/sccs/$CWD"

for FILE in $* ; do				# use all arguments...
    SCCS_FILE=$SCCS/s.$FILE			# determine SCCS file name
    TOP_REV=`prs -d:I: $SCCS_FILE`		# find latest revision
    if [ $? -eq 0 ] ; then
	echo SCCS diff -r$TOP_REV $FILE 1>&2
	get -r$TOP_REV -p $SCCS_FILE | diff - $FILE
    fi
done
