#! /bin/sh
#
# @(#)showhelp	1.4	LPS_UNX_COM	02/19/95
#
# Copyright 1993   Digital Equipment Corporation, Maynard, MA
#
# showhelp
#
# A shell script to optionally display extra help information based
# on the current setting of the HELP variable.  If HELP is non-null,
# then the text is displayed; otherwise, this function acts as a NOOP.
#
# There are two parameters:
#
#   $1 - Boolean value indicating that the screen first should be cleared.
#   $2 - The help text, which can include embedded newlines, etc.
#
# Note that the second parameter is optional.  If it is not present then
# this program will take the help text from stdin.  For long "passages"
# this program may then be used as a filter.
#
# Global variables:
#    HELP
#    PAGER
#
# The exit value is always 0.

if ${HELP:-true}
then
    if $1
    then
	clear
    fi

    if [ "$2" ]
    then
	echo "$2" | ${PAGER:-more}
    else
	${PAGER:-more}
    fi
fi

exit 0
