bin/isabelle_process
changeset 57581 74bbe9317aa4
parent 56628 a2df9de46060
child 58842 22b87ab47d3b
--- a/bin/isabelle_process	Sun Jul 20 17:21:14 2014 +0200
+++ b/bin/isabelle_process	Sun Jul 20 17:54:01 2014 +0200
@@ -27,6 +27,7 @@
   echo
   echo "  Options are:"
   echo "    -I           startup Isar interaction mode"
+  echo "    -O           system options from given YXML file"
   echo "    -P           startup Proof General interaction mode"
   echo "    -S           secure mode -- disallow critical operations"
   echo "    -T ADDR      startup process wrapper, with socket address"
@@ -58,6 +59,7 @@
 # options
 
 ISAR=""
+OPTIONS_FILE=""
 PROOFGENERAL=""
 SECURE=""
 WRAPPER_SOCKET=""
@@ -69,12 +71,15 @@
 READONLY=""
 NOWRITE=""
 
-while getopts "IPST:W:e:m:o:qrw" OPT
+while getopts "IO:PST:W:e:m:o:qrw" OPT
 do
   case "$OPT" in
     I)
       ISAR=true
       ;;
+    O)
+      OPTIONS_FILE="$OPTARG"
+      ;;
     P)
       PROOFGENERAL=true
       ;;
@@ -220,8 +225,15 @@
   MLTEXT="$MLTEXT; Isabelle_Process.init_fifos \"${FIFOS[0]}\" \"${FIFOS[1]}\";"
 else
   ISABELLE_PROCESS_OPTIONS="$ISABELLE_TMP/options"
-  "$ISABELLE_TOOL" options -x "$ISABELLE_PROCESS_OPTIONS" -- "${SYSTEM_OPTIONS[@]}" || \
-    fail "Failed to retrieve Isabelle system options"
+  if [ -n "$OPTIONS_FILE" ]; then
+    [ "${#SYSTEM_OPTIONS[@]}" -gt 0 ] && \
+      fail "Cannot provide options file and options on command-line"
+    mv "$OPTIONS_FILE" "$ISABELLE_PROCESS_OPTIONS" ||
+      fail "Failed to move options file \"$OPTIONS_FILE\""
+  else
+    "$ISABELLE_TOOL" options -x "$ISABELLE_PROCESS_OPTIONS" -- "${SYSTEM_OPTIONS[@]}" || \
+      fail "Failed to retrieve Isabelle system options"
+  fi
   if [ "$INPUT" != RAW_ML_SYSTEM -a "$INPUT" != RAW ]; then
     MLTEXT="Exn.capture_exit 2 Options.load_default (); $MLTEXT"
   fi