10555
|
1 |
#!/usr/bin/env bash
|
2300
|
2 |
#
|
2307
|
3 |
# $Id$
|
9789
|
4 |
# Author: Markus Wenzel, TU Muenchen
|
|
5 |
# License: GPL (GNU GENERAL PUBLIC LICENSE)
|
2307
|
6 |
#
|
2788
|
7 |
# Simple Isabelle interface based on xterm.
|
2300
|
8 |
|
|
9 |
|
|
10 |
## diagnostics
|
|
11 |
|
10512
|
12 |
PRG="$(basename "$0")"
|
2623
|
13 |
|
|
14 |
function usage()
|
|
15 |
{
|
|
16 |
echo
|
|
17 |
echo "Usage: $PRG [OPTIONS] [--] [CMDLINE]"
|
|
18 |
echo
|
|
19 |
echo " Options are:"
|
8598
|
20 |
echo " -I startup Isar interaction mode"
|
2623
|
21 |
echo " -g GEOM main window geometry (default 80x60)"
|
2788
|
22 |
echo " -h MODE highlight mode, may be false, bold (default), color"
|
7206
|
23 |
echo " -m MODE pass print mode"
|
2712
|
24 |
echo " -p TEXT pass text (options etc.) to isabelle session"
|
2623
|
25 |
echo " -s BOOL symbolic font output? (default true)"
|
6344
|
26 |
echo " -x PRG executable program (default xterm)"
|
2623
|
27 |
echo
|
|
28 |
echo " Starts Isabelle within an xterm window. CMDLINE is passed"
|
|
29 |
echo " directly to the isabelle session."
|
|
30 |
echo
|
7459
|
31 |
echo " ISABELLE_XTERM_OPTIONS=$ISABELLE_XTERM_OPTIONS"
|
|
32 |
echo
|
2623
|
33 |
exit 1
|
|
34 |
}
|
|
35 |
|
2300
|
36 |
function fail()
|
|
37 |
{
|
2344
|
38 |
echo "$1" >&2
|
2300
|
39 |
exit 2
|
|
40 |
}
|
|
41 |
|
|
42 |
|
2623
|
43 |
## process command line
|
|
44 |
|
|
45 |
# options
|
|
46 |
|
|
47 |
MAINGEOM="80x60"
|
2788
|
48 |
HILITE=bold
|
2712
|
49 |
PASS=""
|
7206
|
50 |
PASS_MODE=""
|
2623
|
51 |
SYMBOLS="true"
|
6344
|
52 |
XTERM="xterm"
|
2623
|
53 |
|
5965
|
54 |
function getoptions()
|
|
55 |
{
|
|
56 |
OPTIND=1
|
8598
|
57 |
while getopts "Ig:h:m:p:s:x:" OPT
|
5965
|
58 |
do
|
|
59 |
case "$OPT" in
|
8598
|
60 |
I)
|
|
61 |
PASS="$PASS -I"
|
|
62 |
;;
|
5965
|
63 |
g)
|
|
64 |
MAINGEOM="$OPTARG"
|
|
65 |
;;
|
|
66 |
h)
|
|
67 |
HILITE="$OPTARG"
|
|
68 |
;;
|
7206
|
69 |
m)
|
7241
|
70 |
PASS_MODE="$PASS_MODE -m$OPTARG"
|
7206
|
71 |
;;
|
5965
|
72 |
p)
|
|
73 |
PASS="$PASS $OPTARG"
|
|
74 |
;;
|
|
75 |
s)
|
|
76 |
SYMBOLS="$OPTARG"
|
|
77 |
;;
|
6344
|
78 |
x)
|
|
79 |
XTERM="$OPTARG"
|
|
80 |
;;
|
5965
|
81 |
\?)
|
|
82 |
usage
|
|
83 |
;;
|
|
84 |
esac
|
|
85 |
done
|
|
86 |
}
|
2623
|
87 |
|
5965
|
88 |
getoptions $ISABELLE_XTERM_OPTIONS
|
|
89 |
|
|
90 |
getoptions "$@"
|
2623
|
91 |
shift $(($OPTIND - 1))
|
|
92 |
|
|
93 |
|
2300
|
94 |
## main
|
|
95 |
|
2788
|
96 |
if [ "$HILITE" = bold ]; then
|
7241
|
97 |
PASS="-mxterm $PASS"
|
2788
|
98 |
elif [ "$HILITE" = color ]; then
|
7241
|
99 |
PASS="-mxterm_color $PASS"
|
2788
|
100 |
elif [ -n "$HILITE" -a "$HILITE" != false ]; then
|
|
101 |
echo "WARNING: unknown highlight mode '$HILITE'" >&2
|
|
102 |
fi
|
|
103 |
|
7206
|
104 |
PASS="$PASS_MODE $PASS"
|
|
105 |
|
2623
|
106 |
if [ -z "$SYMBOLS" -o "$SYMBOLS" = false ]; then
|
9794
|
107 |
exec $XTERM -T Isabelle -n Isabelle -geometry "$MAINGEOM" -e "$ISABELLE" $PASS "$@"
|
2300
|
108 |
else
|
2474
|
109 |
$ISATOOL installfonts
|
6344
|
110 |
exec $XTERM -T Isabelle -n Isabelle -geometry "$MAINGEOM" -fn isabelle14 \
|
2743
|
111 |
-xrm "*fontMenu.Label: Isabelle fonts" \
|
|
112 |
-xrm "*fontMenu*font1*Label: Large" \
|
2770
|
113 |
-xrm "*VT100*font1: isabelle24" \
|
2743
|
114 |
-xrm "*fontMenu*font2*Label:" \
|
|
115 |
-xrm "*VT100*font2:" \
|
|
116 |
-xrm "*fontMenu*font3*Label:" \
|
|
117 |
-xrm "*VT100*font3:" \
|
|
118 |
-xrm "*fontMenu*font4*Label:" \
|
|
119 |
-xrm "*VT100*font4:" \
|
|
120 |
-xrm "*fontMenu*font5*Label:" \
|
|
121 |
-xrm "*VT100*font5:" \
|
|
122 |
-xrm "*fontMenu*font6*Label:" \
|
|
123 |
-xrm "*VT100*font6:" \
|
9794
|
124 |
-e "$ISABELLE" -m isabelle_font -m symbols $PASS "$@"
|
2300
|
125 |
fi
|