src/Pure/System/main.scala
author wenzelm
Thu Aug 02 12:36:54 2012 +0200 (2012-08-02)
changeset 48646 91281e9472d8
parent 48275 31daac3a85ea
permissions -rw-r--r--
more official command specifications, including source position;
wenzelm@47663
     1
/*  Title:      Pure/System/main.scala
wenzelm@47663
     2
    Author:     Makarius
wenzelm@47663
     3
wenzelm@47663
     4
Default Isabelle application wrapper.
wenzelm@47663
     5
*/
wenzelm@47663
     6
wenzelm@47663
     7
package isabelle
wenzelm@47663
     8
wenzelm@47663
     9
import scala.swing.TextArea
wenzelm@47663
    10
wenzelm@47663
    11
wenzelm@47663
    12
object Main
wenzelm@47663
    13
{
wenzelm@48275
    14
  def main(args: Array[String])
wenzelm@47663
    15
  {
wenzelm@47663
    16
    val (out, rc) =
wenzelm@47663
    17
      try {
wenzelm@47663
    18
        Platform.init_laf()
wenzelm@47663
    19
        Isabelle_System.init()
wenzelm@47663
    20
        Isabelle_System.isabelle_tool("jedit", args: _*)
wenzelm@47663
    21
      }
wenzelm@47663
    22
      catch { case exn: Throwable => (Exn.message(exn), 2) }
wenzelm@47663
    23
wenzelm@47867
    24
    if (rc != 0)
wenzelm@47867
    25
      Library.dialog(null, "Isabelle", "Isabelle output",
wenzelm@47867
    26
        Library.scrollable_text(out + "\nReturn code: " + rc))
wenzelm@47663
    27
wenzelm@48192
    28
    sys.exit(rc)
wenzelm@47663
    29
  }
wenzelm@47663
    30
}
wenzelm@47663
    31