bin/isabelle
changeset 32322 45cb4a86eca2
parent 28934 801098c96f59
child 32390 468eff174a77
     1.1 --- a/bin/isabelle	Tue Aug 04 13:35:33 2009 +0200
     1.2 +++ b/bin/isabelle	Tue Aug 04 15:05:34 2009 +0200
     1.3 @@ -17,6 +17,8 @@
     1.4  ISABELLE_HOME="$(cd "$(dirname "$0")"; cd "$(pwd -P)"; cd ..; pwd)"
     1.5  source "$ISABELLE_HOME/lib/scripts/getsettings" || exit 2
     1.6  
     1.7 +ORIG_IFS="$IFS"; IFS=":"; declare -a TOOLS=($ISABELLE_TOOLS); IFS="$ORIG_IFS"
     1.8 +
     1.9  
    1.10  ## diagnostics
    1.11  
    1.12 @@ -28,24 +30,19 @@
    1.13    echo "  Start Isabelle tool NAME with ARGS; pass \"-?\" for tool specific help."
    1.14    echo
    1.15    echo "  Available tools are:"
    1.16 -  (
    1.17 -    ORIG_IFS="$IFS"
    1.18 -    IFS=":"
    1.19 -    for DIR in $ISABELLE_TOOLS
    1.20 -    do
    1.21 -      if [ -d "$DIR" ]; then
    1.22 -        cd "$DIR"
    1.23 -        for T in *
    1.24 -        do
    1.25 -          if [ -f "$T" -a -x "$T" ]; then
    1.26 -            DESCRLINE=$(fgrep DESCRIPTION: "$T" | sed -e 's/^.*DESCRIPTION: *//')
    1.27 -            echo "    $T - $DESCRLINE"
    1.28 -          fi
    1.29 -        done
    1.30 -      fi
    1.31 -    done
    1.32 -    IFS="$ORIG_IFS"
    1.33 -  )
    1.34 +  for DIR in ${TOOLS[@]}
    1.35 +  do
    1.36 +    if [ -d "$DIR" ]; then
    1.37 +      for TOOL in "$DIR"/*
    1.38 +      do
    1.39 +        if [ -f "$TOOL" -a -x "$TOOL" ]; then
    1.40 +          NAME="$(basename "$TOOL")"
    1.41 +          DESCRLINE="$(fgrep DESCRIPTION: "$TOOL" | sed -e 's/^.*DESCRIPTION: *//')"
    1.42 +          echo "    $NAME - $DESCRLINE"
    1.43 +        fi
    1.44 +      done
    1.45 +    fi
    1.46 +  done
    1.47    exit 1
    1.48  }
    1.49  
    1.50 @@ -66,13 +63,10 @@
    1.51  
    1.52  ## main
    1.53  
    1.54 -ORIG_IFS="$IFS"
    1.55 -IFS=":"
    1.56 -for DIR in $ISABELLE_TOOLS
    1.57 +for DIR in "${TOOLS[@]}"
    1.58  do
    1.59    TOOL="$DIR/$TOOLNAME"
    1.60    [ -f "$TOOL" -a -x "$TOOL" ] && exec "$TOOL" "$@"
    1.61  done
    1.62 -IFS="$ORIG_IFS"
    1.63  
    1.64  fail "Unknown Isabelle tool: $TOOLNAME"