#! /bin/csh
#
#     cats all the manual pages together, suitable for printing
#
if ($#argv > 0) then
     if ("$1" == "-help") then
	echo "$0 generates ASCII on standard output"
        echo "$0 -ps generates postscript on standard output"
        echo "$0 -t  sends troff output to your default printer"
        exit
     endif
#    Put all of the files together
     if ("$1" == "-ps") then
	 find man/man? -type f -exec cat \{\} \; | ptroff -man -t
     else if ("$1" == "-t") then
	 find man/man? -type f -exec cat \{\} \; | troff -man -t | lpr -t
     else
         echo "Unknown option"
     endif
else
    find man/man? -type f -exec cat \{\} \; | nroff -man -Tlpr
endif
