#!/bin/sh

# Hyperhelp wrapper

#    Figure out pathname of this script

case $0 in
/*)     hdir=`dirname $0` ;;
*)      # path is relative, put current directory on front
        dir="${PWD:=`pwd`}/$0"
        dir=`dirname $dir`
        ;;
esac

HDIR=`dirname $hdir`

#    Determine the location of the help resources file and the
#    real hyperhelp executable.

XRES=$HDIR/app-defaults
MACHINE=`uname`
case $MACHINE in
    IRIX)   mt=sgi;;
    AIX)    mt=ibm;;
    esac

HELPBIN=$HDIR/$mt/.hyperhelp

#    If the hyperhelp X app-defaults file exists, merge it's
#    settings with the current X resources.

if test -f $XRES
then
    /usr/bin/X11/xrdb -merge $XRES > /dev/null 2>&1
fi

#    Execute the real hyperhelp executable including any command
#    line options.

$HELPBIN $*
