src/Pure/Tools/main.scala
author wenzelm
Mon, 05 Aug 2013 15:03:52 +0200
changeset 52861 e93d73b51fd0
parent 52675 f3a6b1d0915e
child 53419 1c87e79bb838
permissions -rw-r--r--
commands with overlay remain visible, to avoid loosing printed output;

/*  Title:      Pure/Tools/main.scala
    Author:     Makarius

Default Isabelle application wrapper.
*/

package isabelle

import scala.swing.TextArea


object Main
{
  def main(args: Array[String])
  {
    args.toList match {
      case "-i" :: rest =>
        if (Platform.is_windows) Cygwin_Init.main(rest.toArray)

      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) }

        if (rc != 0)
          GUI.dialog(null, "Isabelle", "Isabelle output",
            GUI.scrollable_text(out + "\nReturn code: " + rc))

        sys.exit(rc)
    }
  }
}