#!/bin/csh -f
#
# PDBVIEW - the editor
#
# Source Version: 2.0
# Software Release #92-0043
#
# include "cpyright.h"
#

set FrontEnd = ""
set DPE = `which pact-dpe`
if ("$DPE" != "") then
   if (-e "$DPE[1]") then
      source $DPE
   endif
endif

set Mode   = 0
set Digits = 4
set Argl   =

while ($#argv > 0)
   switch ($argv[1])
      case -d:
         set Mode = 1
         breaksw
      case -h:
	 echo ""
	 echo "Usage: pdbview [-d] [-h] [-l <command-file>] [-p n] [-r] [<data-file>]"
	 echo ""
	 echo "Options:   d - dump the formatted contents in ASCII to stdout"
	 echo "           h - display this usage information"
	 echo "           l - execute commands in <command-file>"
	 echo "               (not available with -d option)"
	 echo "           p - display floating point numbers with n digits"
	 echo "               (only available with -d option)"
	 echo "           r - don't use the .pdbviewrc file"
	 echo ""
         exit(0)
      case -p:
         shift
         set Digits = $argv[1]
         breaksw
      default:
         set Argl = "$Argl$argv[1] "
         breaksw
   endsw
   shift
end

if ($Mode == 1) then
   $FrontEnd sx -s -l sxview.scm \(binls $Argl $Digits\)
else
   $FrontEnd sx -p $Argl
endif
exit($status)

