#!/bin/sh

#find suffix of name
name=`basename $1`
suffix=`echo $name | sed 's/.*\.//'`

#suppress tabulations in file
# deltab $1

#if ch use chopb else cplus
if [ $suffix = "ch" ]
then
    chopb $1 > $2
elif [ $suffix = "met" ]
then
    metab $1 > $2
elif [ $suffix = "cedit" ]
then
    omt $1 > $2
elif [ $suffix = "asn" ]
then
    asnext -b $1 > $2
else
    cplus $1 > $2
fi
result=$?
if [ $result != 0 ] ; then
    exit $result
fi
if [ $suffix = "asn" ]
then
    echo "asn pretty printing"
fi
