src/Pure/Tools/mkroot.scala
changeset 67043 848672fcaee5
parent 67042 677cab7c2b85
child 67069 f11486d31586
     1.1 --- a/src/Pure/Tools/mkroot.scala	Sat Nov 11 14:55:30 2017 +0100
     1.2 +++ b/src/Pure/Tools/mkroot.scala	Sat Nov 11 15:45:12 2017 +0100
     1.3 @@ -105,8 +105,7 @@
     1.4  \begin{document}
     1.5  
     1.6  \title{""" + (proper_string(title) getOrElse latex_name(name)) + """}
     1.7 -\author{""" +
     1.8 -  (proper_string(author) getOrElse ("By " + latex_name(Isabelle_System.getenv("USER")))) + """}
     1.9 +\author{""" + (proper_string(author) getOrElse latex_name(System.getProperty("user.name"))) + """}
    1.10  \maketitle
    1.11  
    1.12  \tableofcontents
    1.13 @@ -149,16 +148,22 @@
    1.14  
    1.15    val isabelle_tool = Isabelle_Tool("mkroot", "prepare session root directory", args =>
    1.16    {
    1.17 +    var author = ""
    1.18 +    var title = ""
    1.19      var session_name = ""
    1.20  
    1.21      val getopts = Getopts("""
    1.22 -Usage: isabelle mkroot [OPTIONS] [DIR]
    1.23 +Usage: isabelle mkroot [OPTIONS] [DIRECTORY]
    1.24  
    1.25    Options are:
    1.26 -    -n NAME      alternative session name (default: DIR base name)
    1.27 +    -A LATEX     provide author in LaTeX notation (default: user name)
    1.28 +    -T LATEX     provide title in LaTeX notation (default: session name)
    1.29 +    -n NAME      alternative session name (default: directory base name)
    1.30  
    1.31 -  Prepare session root DIR (default: current directory).
    1.32 +  Prepare session root directory (default: current directory).
    1.33  """,
    1.34 +      "A:" -> (arg => author = arg),
    1.35 +      "T:" -> (arg => title = arg),
    1.36        "n:" -> (arg => session_name = arg))
    1.37  
    1.38      val more_args = getopts(args)
    1.39 @@ -170,6 +175,7 @@
    1.40          case _ => getopts.usage()
    1.41        }
    1.42  
    1.43 -    mkroot(session_name = session_name, session_dir = session_dir, progress = new Console_Progress)
    1.44 +    mkroot(session_name = session_name, session_dir = session_dir, author = author, title = title,
    1.45 +      progress = new Console_Progress)
    1.46    })
    1.47  }