#!/bin/sh

cmdLineArgs=""
p4pgfile=""
p4workdir=""
prognamemain=""
tvcommand=${TOTALVIEW:-totalview}

while [ 1 -le $# ] ; do
  arg=$1
  shift
  case $arg in
     -cmdlineargs)
        cmdLineArgs="$1"
        shift
	;;
     -p4pg)
        p4pgfile="$1"
	shift
	;;
     -p4wd)
        p4workdir="$1"
	shift
	;;
     -progname)
        prognamemain="$1"
	shift
	;;
  esac   
done
#
if [ "$just_testing" = 1 ] ; then
    doitall="echo"
else
    # We need the eval to handle arguments containing blanks.
    doitall="eval"
fi
# Note that this is run from within the mpirun.ch_p4 script only (!), so
# the argument list is p4 specific.  FIX ME!
#
$doitall $tvcommand $prognamemain -a $cmdLineArgs -p4pg $p4pgfile -p4wd $p4workdir -mpichtv

