src/Pure/Tools/doc.scala
changeset 56784 776890e0cf71
parent 56631 89269bb8e7ca
child 56831 e3ccf0809d51
equal deleted inserted replaced
56783:afaec818fcfd 56784:776890e0cf71
    75 
    75 
    76   /* view */
    76   /* view */
    77 
    77 
    78   def view(path: Path)
    78   def view(path: Path)
    79   {
    79   {
    80     if (path.is_file) Console.println(File.read(path))
    80     if (path.is_file) System.out.println(Library.trim_line(File.read(path)))
    81     else {
    81     else {
    82       val pdf = path.ext("pdf")
    82       val pdf = path.ext("pdf")
    83       if (pdf.is_file) Isabelle_System.pdf_viewer(pdf)
    83       if (pdf.is_file) Isabelle_System.pdf_viewer(pdf)
    84       else error("Bad Isabelle documentation file: " + pdf)
    84       else error("Bad Isabelle documentation file: " + pdf)
    85     }
    85     }
    90 
    90 
    91   def main(args: Array[String])
    91   def main(args: Array[String])
    92   {
    92   {
    93     Command_Line.tool0 {
    93     Command_Line.tool0 {
    94       val entries = contents()
    94       val entries = contents()
    95       if (args.isEmpty) Console.println(cat_lines(contents_lines().map(_._2)))
    95       if (args.isEmpty) System.out.println(cat_lines(contents_lines().map(_._2)))
    96       else {
    96       else {
    97         args.foreach(arg =>
    97         args.foreach(arg =>
    98           entries.collectFirst { case Doc(name, _, path) if arg == name => path } match {
    98           entries.collectFirst { case Doc(name, _, path) if arg == name => path } match {
    99             case Some(path) => view(path)
    99             case Some(path) => view(path)
   100             case None => error("No Isabelle documentation entry: " + quote(arg))
   100             case None => error("No Isabelle documentation entry: " + quote(arg))