src/Pure/Tools/mkroot.scala
changeset 67042 677cab7c2b85
parent 67041 f8b0367046bd
child 67043 848672fcaee5
     1.1 --- a/src/Pure/Tools/mkroot.scala	Sat Nov 11 14:35:41 2017 +0100
     1.2 +++ b/src/Pure/Tools/mkroot.scala	Sat Nov 11 14:55:30 2017 +0100
     1.3 @@ -22,7 +22,6 @@
     1.4      session_name: String = "",
     1.5      session_dir: Path = Path.current,
     1.6      session_parent: String = "",
     1.7 -    document: Boolean = false,
     1.8      title: String = "",
     1.9      author: String = "",
    1.10      progress: Progress = No_Progress)
    1.11 @@ -36,7 +35,7 @@
    1.12      if (root_path.file.exists) error("Cannot overwrite existing " + root_path)
    1.13  
    1.14      val document_path = session_dir + Path.explode("document")
    1.15 -    if (document && document_path.file.exists) error("Cannot overwrite existing " + document_path)
    1.16 +    if (document_path.file.exists) error("Cannot overwrite existing " + document_path)
    1.17  
    1.18      progress.echo("\nPreparing session " + quote(name) + " in " + session_dir)
    1.19  
    1.20 @@ -46,29 +45,22 @@
    1.21      progress.echo("  creating " + root_path)
    1.22  
    1.23      File.write(root_path,
    1.24 -      "session " + root_name(name) + " = " + root_name(parent) + " +" +
    1.25 -      (if (document) """
    1.26 +      "session " + root_name(name) + " = " + root_name(parent) + """ +
    1.27    options [document = pdf, document_output = "output"]
    1.28 -  theories [document = false]
    1.29 -    (* Foo *)
    1.30 -    (* Bar *)
    1.31 +(*theories [document = false]
    1.32 +    A
    1.33 +    B
    1.34    theories
    1.35 -    (* Baz *)
    1.36 +    C
    1.37 +    D*)
    1.38    document_files
    1.39      "root.tex"
    1.40 -"""
    1.41 -      else """
    1.42 -  options [document = false]
    1.43 -  theories
    1.44 -    (* Foo *)
    1.45 -    (* Bar *)
    1.46 -    (* Baz *)
    1.47 -"""))
    1.48 +""")
    1.49  
    1.50  
    1.51      /* document directory */
    1.52  
    1.53 -    if (document) {
    1.54 +    {
    1.55        val root_tex = session_dir + Path.explode("document/root.tex")
    1.56        progress.echo("  creating " + root_tex)
    1.57  
    1.58 @@ -157,19 +149,16 @@
    1.59  
    1.60    val isabelle_tool = Isabelle_Tool("mkroot", "prepare session root directory", args =>
    1.61    {
    1.62 -    var document = false
    1.63      var session_name = ""
    1.64  
    1.65      val getopts = Getopts("""
    1.66  Usage: isabelle mkroot [OPTIONS] [DIR]
    1.67  
    1.68    Options are:
    1.69 -    -d           enable document preparation
    1.70      -n NAME      alternative session name (default: DIR base name)
    1.71  
    1.72    Prepare session root DIR (default: current directory).
    1.73  """,
    1.74 -      "d" -> (_ => document = true),
    1.75        "n:" -> (arg => session_name = arg))
    1.76  
    1.77      val more_args = getopts(args)
    1.78 @@ -181,7 +170,6 @@
    1.79          case _ => getopts.usage()
    1.80        }
    1.81  
    1.82 -    mkroot(session_name = session_name, session_dir = session_dir, document = document,
    1.83 -      progress = new Console_Progress)
    1.84 +    mkroot(session_name = session_name, session_dir = session_dir, progress = new Console_Progress)
    1.85    })
    1.86  }