#!/bin/sh

if [ "$1" == "PAUSE_ON_ERROR_ONLY" ]
then
	ON_ERROR=1
	PROG=$2
	shift 2
else
	ON_ERROR=0
	PROG=$1
	shift
fi

$PROG "$@"
PRG_ST_EXIT=$?

if [[ ($ON_ERROR == 0) || ( ($ON_ERROR == 1) && ($PRG_ST_EXIT != 0) ) ]]
then
	echo "Press return ..."
	read dummy
fi

exit $PRG_ST_EXIT

