#!/bin/csh -f
#
#  - - - - -
#   H L I B
#  - - - - -
#
#  Translate one or more help libraries from source form to the
#  direct-access file used by the software.
#
#  Command:
#
#      hlib  helpfile
#
#  The help source file called "helpfile" is translated into
#  the file "helpfile.shl".
#
#  !!! WARNING - any files fort.1 and fort.2 are deleted !!!
#
#  It is suggested that help source file names end with ".hlp".
#
#  Thus the command "hlib *.hlp" will translate all help libraries
#  in the current directory into the form required for use.
#
#  P.T.Wallace   Starlink   30 September 1996
#
foreach file (fort.1 fort.2)
   if ( -e $file ) then
      echo "hlib: file $file already exists - cannot proceed"
      exit 1
   endif
end
foreach file ($*)
   cp $file fort.1
   chmod u+w fort.1
   crehlp
   \rm -f fort.1
   mv fort.2 $file:r.shl
end
