#!/bin/sh

trap "/bin/kill -HUP $XSESSION; exit 0" 0 1 2 15

# If the command is of the form shell -c command, exec command
if [ $# -ge 2 ]; then
	if [ x$1 = x-c ]; then
		shift
		exec $*
	fi
fi

# Otherwise run interactively, exit.

while true; do
	cat << EOF

Look to see that there is a small, solid black rectangle (the cursor) at
the bottom of the text before you select 1 or 2. If it is only an
outline, move the mouse so the pointer shows in this window and the
rectangle turns black.

Would you like to
	1. Browse lucy's answers
	2. Ask a question
	3. Quit
Press 1, 2 or 3, then press [Return] or [Enter].
EOF

	choice=0
	while [ 0$choice -lt 1 -o 0$choice -gt 2 ]; do
		read choice
		if [ 0$choice -eq 1 ]; then
			lucybrowse
		elif [ 0$choice -eq 2 ]; then
			ask
			sleep 5
		elif [ 0$choice -eq 3 ]; then
			exit 0
		fi
	done
done
