#! /bin/sh

# $Copyright:	$
# Copyright (c) 1984, 1985, 1986, 1987, 1988, 1989, 1990 
# Sequent Computer Systems, Inc.   All rights reserved.
#  
# This software is furnished under a license and may be used
# only in accordance with the terms of that license and with the
# inclusion of the above copyright notice.   This software may not
# be provided or otherwise made available to, or used by, any
# other person.  No title to or ownership of the software is
# hereby transferred.

#	Copyright (c) 1984 AT&T
#	  All Rights Reserved

#	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T
#	The copyright notice above does not evidence any
#	actual or intended publication of such source code.

#ident	"$Header: checklen.sh 1.4 89/10/10 $@(#)help:checklen.sh	1.3"

while [ "${LEN}" = "bad" ]
do
	${EDITOR} ${EDFILE}
	if [ `wc -l <${EDFILE}` -lt 1 ]
	then
		echo "This help screen may not be empty.  You are being put back into the editor to   enter some data."
	elif [ `wc -l <${EDFILE}` -le ${SCRNLEN} ]
	then
		ANS=~
		while [ \( "${ANS}" != "y" \) -a \( "${ANS}" != "n" \) ]
		do
			echo "Are you satisfied with this screen (y or n)? > \c"
			read ANS
		done
		if [ "${ANS}" = "y" ]
		then
			LEN=good
		else
			echo "You may now re-edit this help screen."
		fi
	else
		CHOICE=~
		while [ \( "${CHOICE}" != "r" \) -a \( "${CHOICE}" != "e" \) ]
		do
			echo "This screen is more than ${SCRNLEN} lines long.  Do you want to"
			echo "re-edit it, or have it expanded to a multi-page screen?"
			echo "Enter choice (r for re-edit, e for expand) > \c"
			read CHOICE
		done
		if [ "${CHOICE}" = "e" ]
		then
			LEN=good
		else
			echo "You may now re-edit this help screen."
		fi
	fi
done
