#! /bin/sh

prefix=/usr
exec_prefix=${prefix}

# %%$@%$# why oh why isn't it $sharedir/monodoc
monodocdir=$prefix/lib/monodoc

case x$1 in
    x--assemble)
	shift;
	echo "--assemble is depreciated. Use mdassembler." 1>&2
	exec mdassembler "$@"
	;;
    x--get-sourcesdir)
	echo "--get-sourcesdir is depreciated. Use pkg-config monodoc --variable=sourcesdir." 1>&2
	exec pkg-config monodoc --variable=sourcesdir
	;;
    x--normalize)
	shift;
	echo "--normalize is depreciated. Use mdnormalizer." 1>&2
	exec mdnormalizer "$@"
	;;
    x--update)
	echo "$0 --update does not work.  Use 'monodocer' instead." 1>&2
	exit 1
	;;
    x--cs-to-ecma)
	shift;
	echo "--cs-to-ecma is depreciated. Use mdcs2ecma." 1>&2
	exec mdcs2ecma "$@"
	;;
    x--validate)
	shift;
	echo "--validator is depreciated. Use mdvalidater." 1>&2
	exec mdvalidater "$@"
	;;
    x--help)
	echo "Usage is:"
	echo "monodoc [options]"
	echo ""
	echo "where [options] is one of the following:"
	echo "  TOPIC              Start the browser at TOPIC"
	echo "      (ex. N:System, T:System.Object, M:System.Object.Equals,"
	echo "      and P: for properties, F: for fields, E: for events, etc.)"
	echo "  --help             Print this message"
	echo "  --html TOPIC       Print the HTML contents of TOPIC"
	echo "  --make-index       Create the documentation index"
	echo
	echo "The following options are available for authoring documentation:"
	echo "  --edit path        Edit (unassembled) documentation at path"
	echo "  --merge-changes CHANGE_FILE [TARGET_DIR]"
	exit 0
	;;
esac

exec /usr/bin/mono $monodocdir/browser.exe $OPTIONS "$@" $REST
