#!/bin/sh

# Wrapper implements command-line INSO filters, e.g., cgm2fmvect
# - determine the input and output formats from the command name (cgm, fmvect)
# - run the fminso script.

: ${FMHOME:?}

usage="Usage: $0 input-filename output-filename""
""or $0 -V""
""or $0 -h"

case "$# $1" in
'2 '[!-]*)
	;;
*' -V')
	echo "$0 version 2.0.0" >&2
	exit 0
	;;
*)
	echo "$usage" >&2
	exit 0
	;;
esac

Program=`basename $0` ssf=$1 ddf=$2
oIFS=$IFS; IFS=" 2""
"; set -- $Program; IFS=$oIFS; infmt=$1 outfmt=$2
exec $FMHOME/bin/scripts/fminso $infmt $outfmt $ssf $ddf
