#!/bin/sh
#
# Copyright (c) Josef "Jeff" Sipek, 2007-2013
#

DO_NOT_CHECK_BRANCH_EXISTENCE=1

USAGE="[<command> | <topic>]"
if [ -z "$GUILT_VERSION" ]; then
	echo "Invoking `basename "$0"` directly is no longer supported." >&2
	exit 1
fi

_main() {

case $# in
	0)
		page="guilt"
		;;
	1)
		case "$1" in
			guilt*)
				# guilt --help
				# guilt-cmd --help
				# guilt-help guilt-foo
				page="$1" ;;
			*)
				# guilt-help foo
				page="guilt-$1" ;;
		esac
		;;
	*)
		usage
		;;
esac

MANDIR=`dirname $0`/../share/man
MANDIR=`(cd "$MANDIR"; pwd)`
exec man -M "$MANDIR" "$page"

}
