if test "$#" = 0; then cat <<\!
Usage: "mmt [ options ] files" where "options" are:
-a	=> output to terminal
-e	=> preprocess input with eqn
-t	=> preprocess input with tbl
-Tst	=> output to MH STARE
-T4014 => output to Tektronix 4014
-Tvp	=> output to Versatec printer
-	=> use instead of "files" when mmt used inside a pipeline.
Other options as required by TROFF and the MM macros.
!
	exit 1
fi
PATH='/bin:/usr/bin'; O='-g'; o='|gcat -ph'; 
#		Assumes typesetter is accessed via gcat(1)
#		If typesetter is on-line, use O=''; o=''
while test -n "$1" -a ! -r "$1"
do case "$1" in
	-a)		O='-a';		o='' ;;
	-Tst)		O='-g';		o='|gcat -st';;
#		Above line for MH STARE only
	-T4014)		O='-t';		o='|tc';;
	-Tvp)		O='-t';		o='|vpr -t';;
	-e)		e='eqn';;
	-t)		f='tbl';;
	-)		break;;
	*)		a="$a $1";;
   esac
   shift
done
if test -z "$1";	then echo 'mmt: no input file'; exit 1; fi
if test "$O" = '-g';	then x="-f$1";	fi
d="$*"
if test "$d" = '-';	then shift;	x='';	d='';	fi
if test -n "$f";	then f="tbl $*|";	d='';	fi
if test -n "$e"
	then	if test -n "$f"
			then e='eqn|'
			else e="eqn $*|";	d=''
		fi
fi
eval "$f $e troff $O -cm $a $d $o $x"
exit 0
