author | wenzelm |
Thu, 06 Mar 1997 12:28:17 +0100 | |
changeset 2735 | 29434f9b95dd |
parent 2703 | 5ce1310560ff |
child 2737 | a43320c05e84 |
permissions | -rwxr-xr-x |
2735
29434f9b95dd
even more robust and user friendly invocation (no longer requieres
wenzelm
parents:
2703
diff
changeset
|
1 |
#!/bin/bash -x |
2293
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
2 |
# |
2307 | 3 |
# $Id$ |
4 |
# |
|
2735
29434f9b95dd
even more robust and user friendly invocation (no longer requieres
wenzelm
parents:
2703
diff
changeset
|
5 |
# Isabelle tool starter -- provides settings environment, |
29434f9b95dd
even more robust and user friendly invocation (no longer requieres
wenzelm
parents:
2703
diff
changeset
|
6 |
# also keeps your PATH name space clean. |
2293
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
7 |
|
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
8 |
|
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
9 |
## settings |
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
10 |
|
2703 | 11 |
PRG=$(basename $0) |
12 |
||
2735
29434f9b95dd
even more robust and user friendly invocation (no longer requieres
wenzelm
parents:
2703
diff
changeset
|
13 |
ISABELLE_HOME=$(dirname $0)/.. |
29434f9b95dd
even more robust and user friendly invocation (no longer requieres
wenzelm
parents:
2703
diff
changeset
|
14 |
. $ISABELLE_HOME/lib/scripts/getsettings || \ |
29434f9b95dd
even more robust and user friendly invocation (no longer requieres
wenzelm
parents:
2703
diff
changeset
|
15 |
{ echo "$PRG probably not called from its original place!"; exit 2 } |
2293
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
16 |
|
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
17 |
|
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
18 |
## diagnostics |
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
19 |
|
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
20 |
function usage() |
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
21 |
{ |
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
22 |
echo |
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
23 |
echo "Usage: $PRG TOOL [ARGS ...]" |
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
24 |
echo |
2434 | 25 |
echo " Start Isabelle utility program TOOL with ARGS. Pass \"-?\" to TOOL" |
26 |
echo " for specific help." |
|
2293
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
27 |
echo |
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
28 |
echo " Availabe tools are:" |
2434 | 29 |
echo |
2293
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
30 |
( |
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
31 |
cd "$ISABELLE_HOME/lib/Tools" |
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
32 |
for T in * |
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
33 |
do |
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
34 |
if [ -f "$T" -a -x "$T" ]; then |
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
35 |
DESCRLINE=$(grep DESCRIPTION: "$T" | sed -e 's/^.*DESCRIPTION: *//') |
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
36 |
echo " $T - $DESCRLINE" |
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
37 |
fi |
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
38 |
done |
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
39 |
) |
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
40 |
echo |
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
41 |
exit 1 |
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
42 |
} |
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
43 |
|
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
44 |
function fail() |
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
45 |
{ |
2344 | 46 |
echo "$1" >&2 |
2293
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
47 |
exit 2 |
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
48 |
} |
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
49 |
|
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
50 |
|
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
51 |
## main |
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
52 |
|
2505 | 53 |
[ $# -lt 1 -o "$1" = "-?" ] && usage |
2293
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
54 |
|
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
55 |
TOOL_BASE="$1" |
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
56 |
TOOL="$ISABELLE_HOME/lib/Tools/$1" |
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
57 |
shift |
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
58 |
|
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
59 |
[ -f "$TOOL" -a -x "$TOOL" ] && exec "$TOOL" "$@" |
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
60 |
|
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
61 |
fail "Tool not found: $TOOL_BASE" |