src/Pure/Tools/doc.scala
changeset 62831 5560905a32ae
parent 62454 38c89353b349
child 67178 70576478bda9
     1.1 --- a/src/Pure/Tools/doc.scala	Sun Apr 03 22:15:40 2016 +0200
     1.2 +++ b/src/Pure/Tools/doc.scala	Sun Apr 03 22:31:16 2016 +0200
     1.3 @@ -91,28 +91,26 @@
     1.4    }
     1.5  
     1.6  
     1.7 -  /* command line entry point */
     1.8 +  /* Isabelle tool wrapper */
     1.9  
    1.10 -  def main(args: Array[String])
    1.11 +  val isabelle_tool = Isabelle_Tool("doc", "view Isabelle documentation", args =>
    1.12    {
    1.13 -    Command_Line.tool0 {
    1.14 -      val getopts = Getopts("""
    1.15 +    val getopts = Getopts("""
    1.16  Usage: isabelle doc [DOC ...]
    1.17  
    1.18    View Isabelle documentation.
    1.19  """)
    1.20 -      val docs = getopts(args)
    1.21 +    val docs = getopts(args)
    1.22  
    1.23 -      val entries = contents()
    1.24 -      if (docs.isEmpty) Console.println(cat_lines(contents_lines().map(_._2)))
    1.25 -      else {
    1.26 -        docs.foreach(doc =>
    1.27 -          entries.collectFirst { case Doc(name, _, path) if doc == name => path } match {
    1.28 -            case Some(path) => view(path)
    1.29 -            case None => error("No Isabelle documentation entry: " + quote(doc))
    1.30 -          }
    1.31 -        )
    1.32 -      }
    1.33 +    val entries = contents()
    1.34 +    if (docs.isEmpty) Console.println(cat_lines(contents_lines().map(_._2)))
    1.35 +    else {
    1.36 +      docs.foreach(doc =>
    1.37 +        entries.collectFirst { case Doc(name, _, path) if doc == name => path } match {
    1.38 +          case Some(path) => view(path)
    1.39 +          case None => error("No Isabelle documentation entry: " + quote(doc))
    1.40 +        }
    1.41 +      )
    1.42      }
    1.43 -  }
    1.44 +  })
    1.45  }