more self-contained application, with side-entry for init;
authorwenzelm
Tue, 16 Jul 2013 14:10:10 +0200
changeset 52675 f3a6b1d0915e
parent 52674 563b7c8279f9
child 52676 f653d0182805
more self-contained application, with side-entry for init;
Isabelle
src/Pure/Tools/main.scala
--- a/Isabelle	Tue Jul 16 13:44:52 2013 +0200
+++ b/Isabelle	Tue Jul 16 14:10:10 2013 +0200
@@ -4,5 +4,5 @@
 #
 # Default Isabelle application wrapper.
 
-exec "$(dirname "$0")"/bin/isabelle jedit -s "$@"
+exec "$(dirname "$0")"/bin/isabelle jedit -s -- "$@"
 
--- a/src/Pure/Tools/main.scala	Tue Jul 16 13:44:52 2013 +0200
+++ b/src/Pure/Tools/main.scala	Tue Jul 16 14:10:10 2013 +0200
@@ -13,19 +13,25 @@
 {
   def main(args: Array[String])
   {
-    val (out, rc) =
-      try {
-        GUI.init_laf()
-        Isabelle_System.init()
-        Isabelle_System.isabelle_tool("jedit", ("-s" :: args.toList): _*)
-      }
-      catch { case exn: Throwable => (Exn.message(exn), 2) }
+    args.toList match {
+      case "-i" :: rest =>
+        if (Platform.is_windows) Cygwin_Init.main(rest.toArray)
 
-    if (rc != 0)
-      GUI.dialog(null, "Isabelle", "Isabelle output",
-        GUI.scrollable_text(out + "\nReturn code: " + rc))
+      case _ =>
+        val (out, rc) =
+          try {
+            GUI.init_laf()
+            Isabelle_System.init()
+            Isabelle_System.isabelle_tool("jedit", ("-s" :: "--" :: args.toList): _*)
+          }
+          catch { case exn: Throwable => (Exn.message(exn), 2) }
 
-    sys.exit(rc)
+        if (rc != 0)
+          GUI.dialog(null, "Isabelle", "Isabelle output",
+            GUI.scrollable_text(out + "\nReturn code: " + rc))
+
+        sys.exit(rc)
+    }
   }
 }