#!/bin/csh -f
#
#	$Id: ftrans,v 1.2.2.1 1993/02/19 17:50:07 haley Exp $
#

set translator="cgmtrans"

if ($#argv < 1) then
	echo 'Improper usage of ftrans: see "man ftrans".'
	exit 1
endif

set cmd
set record

while ($#argv > 0)
	
	switch ($1)

		case "-d":
			shift
			setenv GRAPHCAP $1
			shift
			breaksw

		case "-f":
			shift
			setenv FONTCAP $1
			shift
			breaksw

		case "-r":
			shift
			set record=$1
			shift
			breaksw

		default:
			if ($?file) then
				echo "Too many file names"
				exit 1
			endif

			set file=$1
			shift
	endsw
end

set cmd=($translator $file $record)

$cmd
