where=.Data
case $# in
0) ;; # nothing
*) 
	case $1 in
	-S) where=$SHOME/s/.Functions; shift ;;
	-w) where=$2; shift; shift
	esac
esac
case $where in
*/.Help) where=`echo $where|sed 's/..Help$//'`
esac

case $# in
0) if test ! -d $where/.Help
   	then
		echo "Documentation directory $where/.Help does not exist"
		exit 1
	fi
	cd $where/.Help
	# only one copy of linked files
	files=`ls -i|sort|awk '$1==old{continue}
{old=$1; print $2}'|sort`
	;;
*) files="$@";
	case $1 in
	*/*) ;;	# with slash, a path name
	*)   if test ! -d $where/.Help
		then
			echo "Documentation directory $where/.Help does not exist"
			exit 1
		fi
	cd $where/.Help
	esac
esac
sed -f $SHOME/cmd/detail.sed $files| eqn | troff -rq1 $SHOME/cmd/help.tr - | lp
