1.1 --- a/bin/isatool Sat Oct 04 16:19:49 2008 +0200
1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1.3 @@ -1,78 +0,0 @@
1.4 -#!/usr/bin/env bash
1.5 -#
1.6 -# $Id$
1.7 -# Author: Markus Wenzel, TU Muenchen
1.8 -#
1.9 -# Isabelle tool starter.
1.10 -
1.11 -if [ -L "$0" ]; then
1.12 - TARGET="$(LC_ALL=C ls -l "$0" | sed 's/.* -> //')"
1.13 - exec "$(cd "$(dirname "$0")"; cd "$(pwd -P)"; cd "$(dirname "$TARGET")"; pwd)/$(basename "$TARGET")" "$@"
1.14 -fi
1.15 -
1.16 -
1.17 -## settings
1.18 -
1.19 -PRG="$(basename "$0")"
1.20 -
1.21 -ISABELLE_HOME="$(cd "$(dirname "$0")"; cd "$(pwd -P)"; cd ..; pwd)"
1.22 -source "$ISABELLE_HOME/lib/scripts/getsettings" || exit 2
1.23 -
1.24 -
1.25 -## diagnostics
1.26 -
1.27 -function usage()
1.28 -{
1.29 - echo
1.30 - echo "Usage: $PRG TOOL [ARGS ...]"
1.31 - echo
1.32 - echo " Start Isabelle utility program TOOL with ARGS. Pass \"-?\" to TOOL"
1.33 - echo " for more specific help."
1.34 - echo
1.35 - echo " Available tools are:"
1.36 - (
1.37 - ORIG_IFS="$IFS"
1.38 - IFS=":"
1.39 - for DIR in $ISABELLE_TOOLS
1.40 - do
1.41 - cd "$DIR"
1.42 - for T in *
1.43 - do
1.44 - if [ -f "$T" -a -x "$T" ]; then
1.45 - DESCRLINE=$(fgrep DESCRIPTION: "$T" | sed -e 's/^.*DESCRIPTION: *//')
1.46 - echo " $T - $DESCRLINE"
1.47 - fi
1.48 - done
1.49 - done
1.50 - IFS="$ORIG_IFS"
1.51 - )
1.52 - exit 1
1.53 -}
1.54 -
1.55 -function fail()
1.56 -{
1.57 - echo "$1" >&2
1.58 - exit 2
1.59 -}
1.60 -
1.61 -
1.62 -## args
1.63 -
1.64 -[ "$#" -lt 1 -o "$1" = "-?" ] && usage
1.65 -
1.66 -TOOLNAME="$1"
1.67 -shift
1.68 -
1.69 -
1.70 -## main
1.71 -
1.72 -ORIG_IFS="$IFS"
1.73 -IFS=":"
1.74 -for DIR in $ISABELLE_TOOLS
1.75 -do
1.76 - TOOL="$DIR/$TOOLNAME"
1.77 - [ -f "$TOOL" -a -x "$TOOL" ] && exec "$TOOL" "$@"
1.78 -done
1.79 -IFS="$ORIG_IFS"
1.80 -
1.81 -fail "Unknown Isabelle tool: $TOOLNAME"