#!/bin/csh 
#----------------------------------------------------------------
#                          REVISION HISTORY
#----------------------------------------------------------------
#  MOD             PR
# LEVEL   DATE   NUMBER  User       Description
# ----- -------- ------  ------     -----------------------------
#  000  03/27/02 44775   jschultz   initial implementation
#  001  10/21/09 63755   MSwam      support Java classpath wildcards
#----------------------------------------------------------------
# Script to invoke the JAVA application DumpSup to restore a
# serialized object representing an FGS or AST Subset File and to
# dump the data portions of an object to an ASCII File.
#
#
#-------------------------------------------------------------
# get name and location of output file from cmd line arguments
#-------------------------------------------------------------
if ($#argv == 1) then 
   set fileName = ${argv[1]}
else if ($#argv == 2) then
   set fileSpec = ${argv[1]}
   set fileName = ${argv[2]}
else
   echo "ERROR: incorrect number of arguments specified"
   echo "Usage: dumpsub [<directory spec>] <input file name>"
   echo ""
   exit 1
endif

#
#--------------------------------------------------
# invoke dump routine
#--------------------------------------------------
if ($#argv == 1) then
   eval java -classpath "`replace_javawildcard OPUS_CLASSPATH`" CONVERTFOF/DumpSub -f $fileName 
else
   eval java -classpath "`replace_javawildcard OPUS_CLASSPATH`" CONVERTFOF/DumpSub -d $fileSpec -f $fileName
endif
exit 0
