| author | nipkow | 
| Fri, 07 Jun 2013 12:55:09 +0200 | |
| changeset 52332 | 8cc665635f83 | 
| parent 48858 | 86816c61b5ca | 
| child 62829 | 4141c2a8458b | 
| permissions | -rwxr-xr-x | 
| 10555 | 1 | #!/usr/bin/env bash | 
| 2292 | 2 | # | 
| 9786 | 3 | # Author: Markus Wenzel, TU Muenchen | 
| 2308 | 4 | # | 
| 28504 
7ad7d7d6df47
simplified main Isabelle executables: removed Isabelle and isabelle (replaced by isabelle-process), renamed isatool to isabelle;
 wenzelm parents: 
15967diff
changeset | 5 | # Isabelle tool wrapper. | 
| 2292 | 6 | |
| 15843 | 7 | if [ -L "$0" ]; then | 
| 8 | TARGET="$(LC_ALL=C ls -l "$0" | sed 's/.* -> //')" | |
| 15967 | 9 | exec "$(cd "$(dirname "$0")"; cd "$(pwd -P)"; cd "$(dirname "$TARGET")"; pwd)/$(basename "$TARGET")" "$@" | 
| 15843 | 10 | fi | 
| 11 | ||
| 28504 
7ad7d7d6df47
simplified main Isabelle executables: removed Isabelle and isabelle (replaced by isabelle-process), renamed isatool to isabelle;
 wenzelm parents: 
15967diff
changeset | 12 | |
| 
7ad7d7d6df47
simplified main Isabelle executables: removed Isabelle and isabelle (replaced by isabelle-process), renamed isatool to isabelle;
 wenzelm parents: 
15967diff
changeset | 13 | ## settings | 
| 
7ad7d7d6df47
simplified main Isabelle executables: removed Isabelle and isabelle (replaced by isabelle-process), renamed isatool to isabelle;
 wenzelm parents: 
15967diff
changeset | 14 | |
| 
7ad7d7d6df47
simplified main Isabelle executables: removed Isabelle and isabelle (replaced by isabelle-process), renamed isatool to isabelle;
 wenzelm parents: 
15967diff
changeset | 15 | PRG="$(basename "$0")" | 
| 
7ad7d7d6df47
simplified main Isabelle executables: removed Isabelle and isabelle (replaced by isabelle-process), renamed isatool to isabelle;
 wenzelm parents: 
15967diff
changeset | 16 | |
| 
7ad7d7d6df47
simplified main Isabelle executables: removed Isabelle and isabelle (replaced by isabelle-process), renamed isatool to isabelle;
 wenzelm parents: 
15967diff
changeset | 17 | ISABELLE_HOME="$(cd "$(dirname "$0")"; cd "$(pwd -P)"; cd ..; pwd)" | 
| 
7ad7d7d6df47
simplified main Isabelle executables: removed Isabelle and isabelle (replaced by isabelle-process), renamed isatool to isabelle;
 wenzelm parents: 
15967diff
changeset | 18 | source "$ISABELLE_HOME/lib/scripts/getsettings" || exit 2 | 
| 
7ad7d7d6df47
simplified main Isabelle executables: removed Isabelle and isabelle (replaced by isabelle-process), renamed isatool to isabelle;
 wenzelm parents: 
15967diff
changeset | 19 | |
| 
7ad7d7d6df47
simplified main Isabelle executables: removed Isabelle and isabelle (replaced by isabelle-process), renamed isatool to isabelle;
 wenzelm parents: 
15967diff
changeset | 20 | |
| 
7ad7d7d6df47
simplified main Isabelle executables: removed Isabelle and isabelle (replaced by isabelle-process), renamed isatool to isabelle;
 wenzelm parents: 
15967diff
changeset | 21 | ## diagnostics | 
| 2292 | 22 | |
| 28504 
7ad7d7d6df47
simplified main Isabelle executables: removed Isabelle and isabelle (replaced by isabelle-process), renamed isatool to isabelle;
 wenzelm parents: 
15967diff
changeset | 23 | function usage() | 
| 
7ad7d7d6df47
simplified main Isabelle executables: removed Isabelle and isabelle (replaced by isabelle-process), renamed isatool to isabelle;
 wenzelm parents: 
15967diff
changeset | 24 | {
 | 
| 
7ad7d7d6df47
simplified main Isabelle executables: removed Isabelle and isabelle (replaced by isabelle-process), renamed isatool to isabelle;
 wenzelm parents: 
15967diff
changeset | 25 | echo | 
| 28506 | 26 | echo "Usage: $PRG NAME [ARGS ...]" | 
| 28504 
7ad7d7d6df47
simplified main Isabelle executables: removed Isabelle and isabelle (replaced by isabelle-process), renamed isatool to isabelle;
 wenzelm parents: 
15967diff
changeset | 27 | echo | 
| 28506 | 28 | echo " Start Isabelle tool NAME with ARGS; pass \"-?\" for tool specific help." | 
| 28504 
7ad7d7d6df47
simplified main Isabelle executables: removed Isabelle and isabelle (replaced by isabelle-process), renamed isatool to isabelle;
 wenzelm parents: 
15967diff
changeset | 29 | echo | 
| 48858 | 30 | echo "Available tools:" | 
| 42077 
96c50a4210a2
list Isabelle tools via perl script, which is much faster that bash plumbing, especially on Cygwin;
 wenzelm parents: 
33915diff
changeset | 31 | perl -w "$ISABELLE_HOME/lib/scripts/tools.pl" | 
| 28504 
7ad7d7d6df47
simplified main Isabelle executables: removed Isabelle and isabelle (replaced by isabelle-process), renamed isatool to isabelle;
 wenzelm parents: 
15967diff
changeset | 32 | exit 1 | 
| 
7ad7d7d6df47
simplified main Isabelle executables: removed Isabelle and isabelle (replaced by isabelle-process), renamed isatool to isabelle;
 wenzelm parents: 
15967diff
changeset | 33 | } | 
| 9786 | 34 | |
| 28504 
7ad7d7d6df47
simplified main Isabelle executables: removed Isabelle and isabelle (replaced by isabelle-process), renamed isatool to isabelle;
 wenzelm parents: 
15967diff
changeset | 35 | function fail() | 
| 
7ad7d7d6df47
simplified main Isabelle executables: removed Isabelle and isabelle (replaced by isabelle-process), renamed isatool to isabelle;
 wenzelm parents: 
15967diff
changeset | 36 | {
 | 
| 
7ad7d7d6df47
simplified main Isabelle executables: removed Isabelle and isabelle (replaced by isabelle-process), renamed isatool to isabelle;
 wenzelm parents: 
15967diff
changeset | 37 | echo "$1" >&2 | 
| 
7ad7d7d6df47
simplified main Isabelle executables: removed Isabelle and isabelle (replaced by isabelle-process), renamed isatool to isabelle;
 wenzelm parents: 
15967diff
changeset | 38 | exit 2 | 
| 
7ad7d7d6df47
simplified main Isabelle executables: removed Isabelle and isabelle (replaced by isabelle-process), renamed isatool to isabelle;
 wenzelm parents: 
15967diff
changeset | 39 | } | 
| 
7ad7d7d6df47
simplified main Isabelle executables: removed Isabelle and isabelle (replaced by isabelle-process), renamed isatool to isabelle;
 wenzelm parents: 
15967diff
changeset | 40 | |
| 
7ad7d7d6df47
simplified main Isabelle executables: removed Isabelle and isabelle (replaced by isabelle-process), renamed isatool to isabelle;
 wenzelm parents: 
15967diff
changeset | 41 | |
| 
7ad7d7d6df47
simplified main Isabelle executables: removed Isabelle and isabelle (replaced by isabelle-process), renamed isatool to isabelle;
 wenzelm parents: 
15967diff
changeset | 42 | ## args | 
| 
7ad7d7d6df47
simplified main Isabelle executables: removed Isabelle and isabelle (replaced by isabelle-process), renamed isatool to isabelle;
 wenzelm parents: 
15967diff
changeset | 43 | |
| 
7ad7d7d6df47
simplified main Isabelle executables: removed Isabelle and isabelle (replaced by isabelle-process), renamed isatool to isabelle;
 wenzelm parents: 
15967diff
changeset | 44 | [ "$#" -lt 1 -o "$1" = "-?" ] && usage | 
| 
7ad7d7d6df47
simplified main Isabelle executables: removed Isabelle and isabelle (replaced by isabelle-process), renamed isatool to isabelle;
 wenzelm parents: 
15967diff
changeset | 45 | |
| 
7ad7d7d6df47
simplified main Isabelle executables: removed Isabelle and isabelle (replaced by isabelle-process), renamed isatool to isabelle;
 wenzelm parents: 
15967diff
changeset | 46 | TOOLNAME="$1" | 
| 
7ad7d7d6df47
simplified main Isabelle executables: removed Isabelle and isabelle (replaced by isabelle-process), renamed isatool to isabelle;
 wenzelm parents: 
15967diff
changeset | 47 | shift | 
| 
7ad7d7d6df47
simplified main Isabelle executables: removed Isabelle and isabelle (replaced by isabelle-process), renamed isatool to isabelle;
 wenzelm parents: 
15967diff
changeset | 48 | |
| 
7ad7d7d6df47
simplified main Isabelle executables: removed Isabelle and isabelle (replaced by isabelle-process), renamed isatool to isabelle;
 wenzelm parents: 
15967diff
changeset | 49 | |
| 
7ad7d7d6df47
simplified main Isabelle executables: removed Isabelle and isabelle (replaced by isabelle-process), renamed isatool to isabelle;
 wenzelm parents: 
15967diff
changeset | 50 | ## main | 
| 
7ad7d7d6df47
simplified main Isabelle executables: removed Isabelle and isabelle (replaced by isabelle-process), renamed isatool to isabelle;
 wenzelm parents: 
15967diff
changeset | 51 | |
| 42077 
96c50a4210a2
list Isabelle tools via perl script, which is much faster that bash plumbing, especially on Cygwin;
 wenzelm parents: 
33915diff
changeset | 52 | splitarray ":" "$ISABELLE_TOOLS"; TOOLS=("${SPLITARRAY[@]}")
 | 
| 
96c50a4210a2
list Isabelle tools via perl script, which is much faster that bash plumbing, especially on Cygwin;
 wenzelm parents: 
33915diff
changeset | 53 | |
| 32322 
45cb4a86eca2
change IFS only locally -- thanks to bash arrays;
 wenzelm parents: 
28934diff
changeset | 54 | for DIR in "${TOOLS[@]}"
 | 
| 28504 
7ad7d7d6df47
simplified main Isabelle executables: removed Isabelle and isabelle (replaced by isabelle-process), renamed isatool to isabelle;
 wenzelm parents: 
15967diff
changeset | 55 | do | 
| 
7ad7d7d6df47
simplified main Isabelle executables: removed Isabelle and isabelle (replaced by isabelle-process), renamed isatool to isabelle;
 wenzelm parents: 
15967diff
changeset | 56 | TOOL="$DIR/$TOOLNAME" | 
| 42077 
96c50a4210a2
list Isabelle tools via perl script, which is much faster that bash plumbing, especially on Cygwin;
 wenzelm parents: 
33915diff
changeset | 57 | case "$TOOL" in | 
| 42124 | 58 | *~ | *.orig) ;; | 
| 42077 
96c50a4210a2
list Isabelle tools via perl script, which is much faster that bash plumbing, especially on Cygwin;
 wenzelm parents: 
33915diff
changeset | 59 | *) [ -f "$TOOL" -a -x "$TOOL" ] && exec "$TOOL" "$@" ;; | 
| 
96c50a4210a2
list Isabelle tools via perl script, which is much faster that bash plumbing, especially on Cygwin;
 wenzelm parents: 
33915diff
changeset | 60 | esac | 
| 28504 
7ad7d7d6df47
simplified main Isabelle executables: removed Isabelle and isabelle (replaced by isabelle-process), renamed isatool to isabelle;
 wenzelm parents: 
15967diff
changeset | 61 | done | 
| 
7ad7d7d6df47
simplified main Isabelle executables: removed Isabelle and isabelle (replaced by isabelle-process), renamed isatool to isabelle;
 wenzelm parents: 
15967diff
changeset | 62 | |
| 
7ad7d7d6df47
simplified main Isabelle executables: removed Isabelle and isabelle (replaced by isabelle-process), renamed isatool to isabelle;
 wenzelm parents: 
15967diff
changeset | 63 | fail "Unknown Isabelle tool: $TOOLNAME" |