#!/bin/bash -norc
#
# $Id$
#
# Isabelle within an xterm.
# FIXME startup prefix (ISABELLE_COMMAND_LINE !?)
## diagnostics
PRG=$(basename $0)
function usage()
{
echo
echo "Usage: $PRG [OPTIONS] [--] [CMDLINE]"
echo
echo " Options are:"
echo " -g GEOM main window geometry (default 80x60)"
echo " -s BOOL symbolic font output? (default true)"
#FIXME
# echo " -r BOOL actually run isabelle? (default true)"
echo
echo " Starts Isabelle within an xterm window. CMDLINE is passed"
echo " directly to the isabelle session."
echo
exit 1
}
function fail()
{
echo "$1" >&2
exit 2
}
## process command line
# options
MAINGEOM="80x60"
SYMBOLS="true"
RUN="true"
while getopts "g:r:s:" OPT
do
case "$OPT" in
g)
MAINGEOM="$OPTARG"
;;
r)
RUN="$OPTARG"
;;
s)
SYMBOLS="$OPTARG"
;;
\?)
usage
;;
esac
done
shift $(($OPTIND - 1))
## main
if [ -z "$RUN" -o "$RUN" = false ]; then
RUN=""
else
RUN=true
fi
if [ -z "$SYMBOLS" -o "$SYMBOLS" = false ]; then
if [ -z "$RUN" ]; then
exec xterm -T Isabelle -n Isabelle -geometry "$MAINGEOM"
else
exec xterm -T Isabelle -n Isabelle -geometry "$MAINGEOM" -e $ISABELLE "$@"
fi
else
$ISATOOL installfonts
if [ -z "$RUN" ]; then
exec xterm -T Isabelle -n Isabelle -geometry "$MAINGEOM" -fn isacr14 \
-xrm "*fontMenu.Label: Isabelle fonts" \
-xrm "*fontMenu*font1*Label: Large" \
-xrm "*VT100*font1: isacb24" \
-xrm "*fontMenu*font2*Label:" \
-xrm "*VT100*font2:" \
-xrm "*fontMenu*font3*Label:" \
-xrm "*VT100*font3:" \
-xrm "*fontMenu*font4*Label:" \
-xrm "*VT100*font4:" \
-xrm "*fontMenu*font5*Label:" \
-xrm "*VT100*font5:" \
-xrm "*fontMenu*font6*Label:" \
-xrm "*VT100*font6:"
else
exec xterm -T Isabelle -n Isabelle -geometry "$MAINGEOM" -fn isacr14 \
-xrm "*fontMenu.Label: Isabelle fonts" \
-xrm "*fontMenu*font1*Label: Large" \
-xrm "*VT100*font1: isacb24" \
-xrm "*fontMenu*font2*Label:" \
-xrm "*VT100*font2:" \
-xrm "*fontMenu*font3*Label:" \
-xrm "*VT100*font3:" \
-xrm "*fontMenu*font4*Label:" \
-xrm "*VT100*font4:" \
-xrm "*fontMenu*font5*Label:" \
-xrm "*VT100*font5:" \
-xrm "*fontMenu*font6*Label:" \
-xrm "*VT100*font6:" \
-e $ISABELLE -e 'print_mode:=["symbols"];' "$@"
fi
fi