#!/bin/sh
dist_bin="/usr/lib/mozilla"
script_args=""
moreargs=""
debugging=0
MOZILLA_BIN="mozilla-bin"

if [ "$OSTYPE" = "beos" ]; then
  mimeset -F $MOZILLA_BIN
fi

while [ $# -gt 0 ]
do
  case "$1" in
    -p | -pure)
      MOZILLA_BIN="mozilla-bin.pure"
      shift
      ;;
    -g | --debug)
      script_args="$script_args -g"
      debugging=1
      shift
      ;;
    -d | --debugger)
      script_args="$script_args -d $2"
      shift 2
      ;;
    *)
      moreargs="$moreargs \"$1\""
      shift 1
      ;;
  esac
done

eval "set -- $moreargs"
if [ $debugging = 1 ]
then
  echo $dist_bin/run-mozilla.sh $script_args $dist_bin/$MOZILLA_BIN "$@"
fi
exec $dist_bin/run-mozilla.sh $script_args $dist_bin/$MOZILLA_BIN "$@"
