#!/bin/csh
#
# Name: fitsverify2
#
# Description: Calls the FITS verification tools for each command line
#              argument (each interpreted as a filename), using the more
#              lenient form of verification (see fitsverify for the more
#              strict form of checks).
#
# Returns:     whatever fitsverify_file_lenient returns
#
#---------------------------------------------------------------------------
if ($#argv > 0) then
  # set list to all of the passed args
  set Plist = ($*)
else
  # no arg list, default to something
  set Plist = (*.fits)
endif
#
# clear out any leftover log from a previous run
rm fitsverify.out
#
# verify each file
foreach i ($Plist)
  fitsverify_file_lenient ${i}
  # NOTE: an error for a file causes IMMEDIATE exit (the remaining files
  #       are NOT checked during this run)
  if ($status != 0) then
     exit $status
  endif
end
exit 0
