author | wenzelm |
Mon, 13 Jan 1997 13:20:32 +0100 | |
changeset 2505 | 50abca9d4043 |
parent 2434 | d3d42a2e7da2 |
child 2703 | 5ce1310560ff |
permissions | -rwxr-xr-x |
2344 | 1 |
#!/bin/bash -norc |
2293
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
2 |
# |
2307 | 3 |
# $Id$ |
4 |
# |
|
2293
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
5 |
# Isabelle tool starter -- keeps your PATH name space clean. |
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
6 |
|
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 |
## settings |
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
9 |
|
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
10 |
ISABELLE_HOME=$(dirname $(dirname $0)) |
2395 | 11 |
. $ISABELLE_HOME/lib/scripts/getsettings || exit 2 |
2293
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
12 |
|
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
13 |
|
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
14 |
## diagnostics |
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
15 |
|
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
16 |
PRG=$(basename $0) |
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 |
function usage() |
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 |
echo |
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
21 |
echo "Usage: $PRG TOOL [ARGS ...]" |
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
22 |
echo |
2434 | 23 |
echo " Start Isabelle utility program TOOL with ARGS. Pass \"-?\" to TOOL" |
24 |
echo " for specific help." |
|
2293
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
25 |
echo |
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
26 |
echo " Availabe tools are:" |
2434 | 27 |
echo |
2293
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
28 |
( |
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
29 |
cd "$ISABELLE_HOME/lib/Tools" |
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
30 |
for T in * |
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
31 |
do |
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
32 |
if [ -f "$T" -a -x "$T" ]; then |
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
33 |
DESCRLINE=$(grep DESCRIPTION: "$T" | sed -e 's/^.*DESCRIPTION: *//') |
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
34 |
echo " $T - $DESCRLINE" |
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
35 |
fi |
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
36 |
done |
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
37 |
) |
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
38 |
echo |
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
39 |
exit 1 |
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
40 |
} |
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
41 |
|
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
42 |
function fail() |
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
43 |
{ |
2344 | 44 |
echo "$1" >&2 |
2293
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
45 |
exit 2 |
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
46 |
} |
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
47 |
|
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 |
## main |
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
50 |
|
2505 | 51 |
[ $# -lt 1 -o "$1" = "-?" ] && usage |
2293
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
52 |
|
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
53 |
TOOL_BASE="$1" |
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
54 |
TOOL="$ISABELLE_HOME/lib/Tools/$1" |
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
55 |
shift |
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
56 |
|
749757db3ead
isatool: Isabelle tool starter -- keeps your PATH name space clean.
wenzelm
parents:
diff
changeset
|
57 |
[ -f "$TOOL" -a -x "$TOOL" ] && exec "$TOOL" "$@" |
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 |
fail "Tool not found: $TOOL_BASE" |