src/Pure/System/isabelle_tool.scala
changeset 64161 2b1128e95dfb
parent 64143 578e71c2c976
child 64304 96bc94c87a81
     1.1 --- a/src/Pure/System/isabelle_tool.scala	Wed Oct 12 09:38:20 2016 +0200
     1.2 +++ b/src/Pure/System/isabelle_tool.scala	Wed Oct 12 10:22:34 2016 +0200
     1.3 @@ -113,11 +113,12 @@
     1.4        Update_Theorems.isabelle_tool)
     1.5  
     1.6    private def list_internal(): List[(String, String)] =
     1.7 -    for (tool <- internal_tools.toList) yield (tool.name, tool.description)
     1.8 +    for (tool <- internal_tools.toList if tool.accessible)
     1.9 +      yield (tool.name, tool.description)
    1.10  
    1.11    private def find_internal(name: String): Option[List[String] => Unit] =
    1.12      internal_tools.collectFirst({
    1.13 -      case tool if tool.name == name =>
    1.14 +      case tool if tool.name == name && tool.accessible =>
    1.15          args => Command_Line.tool0 { tool.body(args) }
    1.16        })
    1.17  
    1.18 @@ -148,4 +149,8 @@
    1.19    }
    1.20  }
    1.21  
    1.22 -sealed case class Isabelle_Tool(name: String, description: String, body: List[String] => Unit)
    1.23 +sealed case class Isabelle_Tool(
    1.24 +  name: String, description: String, body: List[String] => Unit, admin: Boolean = false)
    1.25 +{
    1.26 +  def accessible: Boolean = !admin || Isabelle_System.admin()
    1.27 +}