#!/bin/bash

echo
echo This script will print out the complete Documentation for elvis.
echo It does this by invoking elvis on each documentation file, and having
echo elvis print the file via its :lpr command.
echo
echo    THIS ASSUMES YOUR PRINTER IS CONFIGURED AND READY TO PRINT!
echo
echo Printing the complete Documentation for elvis requires about 130 pages.

if [ -e /usr/lib/elvis/ctags.man ] ; then 
	echo
	echo The elvisctags package is installed, so its docs will be printed also.
else
	echo
	echo The elvisctags package is not installed, so its docs will be skipped.
fi
echo
echo -n "Are you sure you wish to proceed? [Y/n] "

read ans

if [ $ans != "Y" ] ; then
	echo 
	exit 1
fi
 
echo printing...
echo

cd /usr/doc/elvis/online-help

elvis -Gquit -clp elvis.html
elvis -Gquit -clp elvisvi.html
elvis -Gquit -clp elvisinp.html
elvis -Gquit -clp elvisex.html
elvis -Gquit -clp elvisre.html
elvis -Gquit -clp elvisopt.html
elvis -Gquit -clp elvisdm.html
elvis -Gquit -clp elvisgui.html
elvis -Gquit -clp elvisses.html
elvis -Gquit -clp elviscut.html
elvis -Gquit -clp elvismsg.html
elvis -Gquit -clp elvisexp.html
elvis -Gquit -clp elvistip.html
elvis -Gquit -clp elvis.man
if [ -e ctags.man ] ; then 
	elvis -Gquit -clp ctags.man
fi
if [ -e ref.man ] ; then 
	elvis -Gquit -clp ref.man
fi

