#!/local/bin/sh

prog=0; rout=0; form=0; verb=0; files="";

while test $# -gt 0
do
  case $1 in
  -p) prog=1;;
  -r) rout=1;;
  -f) form=1;;
  -v) verb=1;;
  *)  files="$files $1";;
  esac
  shift
done

dir=`dirname $0`
makeHtmlManList=$dir/makeHtmlManList

if test $verb -eq 1
then
cat <<EOF

This is a list of one-line manual page summaries for XITE.

EOF
fi

if test $verb -eq 1 -a $prog -eq 1
then
cat <<EOF
XITE programs (man section 1):

EOF
fi

if test $prog -eq 1
then
  grep '(1)' $files | grep -vi 'XITE (1)' | $makeHtmlManList -man
fi

if test $verb -eq 1 -a $rout -eq 1
then
cat <<EOF

XITE functions (man section 3):

EOF
fi

if test $rout -eq 1
then
  grep '(3)' $files | $makeHtmlManList -man
fi

if test $verb -eq 1 -a $form -eq 1
then
cat <<EOF

XITE BIFF file format (man section 5):

EOF
fi

if test $form -eq 1
then
  grep '(5)' $files | $makeHtmlManList -man
fi
