#!/bin/sh

if [ x$VIM = x ] ; then
    echo "Error, VIM environment variable must be set (see vim documentation)"
    exit 1
fi

echo "To use this script, you must have X windows running and have access to gvim."
echo "Warning, this will take some time!."
# echo "\nAbout to colourize the following files: " *.[ch]
echo "\nAbout to colourize the following files: " $*
echo "For each file foo,bar, this script will create foo.bar.html"
# for f in *.[ch]; do 
for f in $*
do 
    echo "Colourizing " $f
    gvim -f +"syn on" +"so \$VIM/syntax/2html.vim" +"wq" +"q" $f; 
done
echo "Done."
