src/Pure/System/command_line.ML
author wenzelm
Thu, 15 Jul 2021 16:35:45 +0200
changeset 73987 fc363a3b690a
parent 71656 3e121f999120
child 78671 66e7a3131fe3
permissions -rw-r--r--
build.props for isabelle.jar, including isabelle.jedit; build minimal Isabelle/jEdit plugins on the spot; regular "jedit" component: discontinued special "jedit_build"; Isabelle/Scala services via jars, instead of settings;

(*  Title:      Pure/System/command_line.ML
    Author:     Makarius

Support for Isabelle/ML command line tools.
*)

signature COMMAND_LINE =
sig
  val tool: (unit -> unit) -> unit
end;

structure Command_Line: COMMAND_LINE =
struct

fun tool body =
  Thread_Attributes.uninterruptible (fn restore_attributes => fn () =>
    let
      val rc =
        (restore_attributes body (); 0)
          handle exn => Exn.capture_exit 2 (fn () => (Runtime.exn_error_message exn; raise exn)) ();
    in exit rc end) ();

end;