10555
|
1 |
#!/usr/bin/env bash
|
3640
|
2 |
#
|
|
3 |
# $Id$
|
9788
|
4 |
# Author: Markus Wenzel, TU Muenchen
|
|
5 |
# License: GPL (GNU GENERAL PUBLIC LICENSE)
|
3640
|
6 |
#
|
7766
|
7 |
# DESCRIPTION: Isabelle graph browser
|
3640
|
8 |
|
|
9 |
|
10511
|
10 |
PRG="$(basename "$0")"
|
3640
|
11 |
|
|
12 |
function usage()
|
|
13 |
{
|
|
14 |
echo
|
9237
|
15 |
echo "Usage: $PRG [OPTIONS] [GRAPHFILE]"
|
3640
|
16 |
echo
|
7766
|
17 |
echo " Options are:"
|
|
18 |
echo " -d delete file after use"
|
|
19 |
echo
|
3640
|
20 |
exit 1
|
|
21 |
}
|
|
22 |
|
7766
|
23 |
## process command line
|
|
24 |
|
|
25 |
# options
|
|
26 |
|
|
27 |
DELETE=""
|
|
28 |
|
|
29 |
while getopts "d" OPT
|
|
30 |
do
|
|
31 |
case "$OPT" in
|
|
32 |
d)
|
|
33 |
DELETE=true
|
|
34 |
;;
|
|
35 |
\?)
|
|
36 |
usage
|
|
37 |
;;
|
|
38 |
esac
|
|
39 |
done
|
|
40 |
|
|
41 |
shift $(($OPTIND - 1))
|
|
42 |
|
|
43 |
|
|
44 |
# args
|
|
45 |
|
|
46 |
GRAPHFILE=""
|
9788
|
47 |
[ "$#" -gt 0 ] && { GRAPHFILE="$1"; shift; }
|
|
48 |
[ "$#" -ne 0 ] && usage
|
7766
|
49 |
|
3640
|
50 |
|
|
51 |
## main
|
|
52 |
|
9788
|
53 |
export CLASSPATH="$ISABELLE_HOME/lib/browser"
|
9794
|
54 |
if [ -z "$GRAPHFILE" ]; then
|
|
55 |
cd "$ISABELLE_BROWSER_INFO"
|
|
56 |
exec java GraphBrowser.GraphBrowser
|
|
57 |
else
|
|
58 |
java GraphBrowser.GraphBrowser "$GRAPHFILE"
|
|
59 |
[ -n "$DELETE" ] && rm -f "$GRAPHFILE"
|
|
60 |
fi
|
3640
|
61 |
|