#!/bin/sh

prefix=/usr
exec_prefix=${prefix}
monodocdir=${exec_prefix}/lib/monodoc

if test "x$1" = x; then
    echo Usage is: mod TOPIC
    exit 1;
fi

if `which lynx >& /dev/null` > /dev/null; then
    /usr/bin/mono $monodocdir/mod.exe "$1" | lynx -dump -stdin -force_html | ${PAGER:-more}
else
    tmp=$HOME/.monodoc-tmp-$$
    /usr/bin/mono $monodocdir/mod.exe "$1" > $tmp
    links -dump -force-html $tmp | ${PAGER:-more}
    rm $tmp
fi
