improved interface options;
authorwenzelm
Fri Feb 14 15:29:20 1997 +0100 (1997-02-14)
changeset 26236a7372c9ca0f
parent 2622 80a81a36dd81
child 2624 ab311b6e5e29
improved interface options;
lib/scripts/isa-xterm
     1.1 --- a/lib/scripts/isa-xterm	Fri Feb 14 15:16:21 1997 +0100
     1.2 +++ b/lib/scripts/isa-xterm	Fri Feb 14 15:29:20 1997 +0100
     1.3 @@ -4,9 +4,29 @@
     1.4  #
     1.5  # Isabelle within an xterm.
     1.6  
     1.7 +# FIXME startup prefix (ISABELLE_COMMAND_LINE !?)
     1.8  
     1.9  ## diagnostics
    1.10  
    1.11 +PRG=$(basename $0)
    1.12 +
    1.13 +function usage()
    1.14 +{
    1.15 +  echo
    1.16 +  echo "Usage: $PRG [OPTIONS] [--] [CMDLINE]"
    1.17 +  echo
    1.18 +  echo "  Options are:"
    1.19 +  echo "    -g GEOM      main window geometry (default 80x60)"
    1.20 +  echo "    -s BOOL      symbolic font output? (default true)"
    1.21 +#FIXME
    1.22 +#  echo "    -r BOOL      actually run isabelle? (default true)"
    1.23 +  echo
    1.24 +  echo "  Starts Isabelle within an xterm window. CMDLINE is passed"
    1.25 +  echo "  directly to the isabelle session."
    1.26 +  echo
    1.27 +  exit 1
    1.28 +}
    1.29 +
    1.30  function fail()
    1.31  {
    1.32    echo "$1" >&2
    1.33 @@ -14,26 +34,81 @@
    1.34  }
    1.35  
    1.36  
    1.37 +## process command line
    1.38 +
    1.39 +# options
    1.40 +
    1.41 +MAINGEOM="80x60"
    1.42 +SYMBOLS="true"
    1.43 +RUN="true"
    1.44 +
    1.45 +while getopts "g:r:s:" OPT
    1.46 +do
    1.47 +  case "$OPT" in
    1.48 +    g)
    1.49 +      MAINGEOM="$OPTARG"
    1.50 +      ;;
    1.51 +    r)
    1.52 +      RUN="$OPTARG"
    1.53 +      ;;
    1.54 +    s)
    1.55 +      SYMBOLS="$OPTARG"
    1.56 +      ;;
    1.57 +    \?)
    1.58 +      usage
    1.59 +      ;;
    1.60 +  esac
    1.61 +done
    1.62 +
    1.63 +shift $(($OPTIND - 1))
    1.64 +
    1.65 +
    1.66  ## main
    1.67  
    1.68 -if [ -z "$ISABELLE_SYMBOLS" -o "$ISABELLE_SYMBOLS" = false ]; then
    1.69 -  exec xterm -T Isabelle -n Isabelle $ISABELLE_INTERFACE_OPTIONS \
    1.70 -    -e $ISABELLE "$@"
    1.71 +if [ -z "$RUN" -o "$RUN" = false ]; then
    1.72 +  RUN=""
    1.73 +else
    1.74 +  RUN=true
    1.75 +fi
    1.76 +
    1.77 +if [ -z "$SYMBOLS" -o "$SYMBOLS" = false ]; then
    1.78 +  if [ -z "$RUN" ]; then
    1.79 +    exec xterm -T Isabelle -n Isabelle -geometry "$MAINGEOM"
    1.80 +  else
    1.81 +    exec xterm -T Isabelle -n Isabelle -geometry "$MAINGEOM" -e $ISABELLE "$@"
    1.82 +  fi
    1.83  else
    1.84    $ISATOOL installfonts
    1.85 -  exec xterm -T Isabelle -n Isabelle $ISABELLE_INTERFACE_OPTIONS -fn isacr14 \
    1.86 -    -xrm "*fontMenu.Label: Isabelle fonts" \
    1.87 -    -xrm "*fontMenu*font1*Label: Large" \
    1.88 -    -xrm "*VT100*font1: isacb24" \
    1.89 -    -xrm "*fontMenu*font2*Label:" \
    1.90 -    -xrm "*VT100*font2:" \
    1.91 -    -xrm "*fontMenu*font3*Label:" \
    1.92 -    -xrm "*VT100*font3:" \
    1.93 -    -xrm "*fontMenu*font4*Label:" \
    1.94 -    -xrm "*VT100*font4:" \
    1.95 -    -xrm "*fontMenu*font5*Label:" \
    1.96 -    -xrm "*VT100*font5:" \
    1.97 -    -xrm "*fontMenu*font6*Label:" \
    1.98 -    -xrm "*VT100*font6:" \
    1.99 -    -e $ISABELLE -e 'print_mode:=["symbols"];' "$@"
   1.100 +  if [ -z "$RUN" ]; then
   1.101 +    exec xterm -T Isabelle -n Isabelle -geometry "$MAINGEOM" -fn isacr14 \
   1.102 +      -xrm "*fontMenu.Label: Isabelle fonts" \
   1.103 +      -xrm "*fontMenu*font1*Label: Large" \
   1.104 +      -xrm "*VT100*font1: isacb24" \
   1.105 +      -xrm "*fontMenu*font2*Label:" \
   1.106 +      -xrm "*VT100*font2:" \
   1.107 +      -xrm "*fontMenu*font3*Label:" \
   1.108 +      -xrm "*VT100*font3:" \
   1.109 +      -xrm "*fontMenu*font4*Label:" \
   1.110 +      -xrm "*VT100*font4:" \
   1.111 +      -xrm "*fontMenu*font5*Label:" \
   1.112 +      -xrm "*VT100*font5:" \
   1.113 +      -xrm "*fontMenu*font6*Label:" \
   1.114 +      -xrm "*VT100*font6:"
   1.115 +  else
   1.116 +    exec xterm -T Isabelle -n Isabelle -geometry "$MAINGEOM" -fn isacr14 \
   1.117 +      -xrm "*fontMenu.Label: Isabelle fonts" \
   1.118 +      -xrm "*fontMenu*font1*Label: Large" \
   1.119 +      -xrm "*VT100*font1: isacb24" \
   1.120 +      -xrm "*fontMenu*font2*Label:" \
   1.121 +      -xrm "*VT100*font2:" \
   1.122 +      -xrm "*fontMenu*font3*Label:" \
   1.123 +      -xrm "*VT100*font3:" \
   1.124 +      -xrm "*fontMenu*font4*Label:" \
   1.125 +      -xrm "*VT100*font4:" \
   1.126 +      -xrm "*fontMenu*font5*Label:" \
   1.127 +      -xrm "*VT100*font5:" \
   1.128 +      -xrm "*fontMenu*font6*Label:" \
   1.129 +      -xrm "*VT100*font6:" \
   1.130 +      -e $ISABELLE -e 'print_mode:=["symbols"];' "$@"
   1.131 +  fi
   1.132  fi