gentexifile 596 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
#!/bin/sh

if [ $# = 0 ]; then
  echo "Usage: $0 <file to translate> [<texi target>]"
  exit 1
fi

SOURCE=$1
if [ $# = 2 ]; then
   TARGET=$2
else
   TARGET=`basename ${SOURCE}`.texi
fi
case ${SOURCE} in
  *.aadl)
    SEDFILE=aadl.sed;;
  *.adb)
    SEDFILE=ada.sed;;
  *.ads)
    SEDFILE=ada.sed;;
  *.ada)
    SEDFILE=ada.sed;;
  *)
    echo "Cannot translate file";
    exit 1;;
esac
echo "@smallexample"             >${TARGET}
echo ""                     >>${TARGET}
sed -f ${SEDFILE} ${SOURCE} >>${TARGET}
echo ""                     >>${TARGET}
echo "@end smallexample"         >>${TARGET}