clarified isabelle options -l;
authorwenzelm
Tue, 29 Oct 2013 16:52:25 +0100
changeset 54347 d5589530f3ba
parent 54346 a3c59f04346f
child 54348 923690bfb818
clarified isabelle options -l;
src/Doc/System/Sessions.thy
src/Pure/System/options.scala
--- a/src/Doc/System/Sessions.thy	Tue Oct 29 15:34:29 2013 +0100
+++ b/src/Doc/System/Sessions.thy	Tue Oct 29 16:52:25 2013 +0100
@@ -249,6 +249,8 @@
   \secref{sec:tool-build}.
 
   Option @{verbatim "-g"} prints the value of the given option.
+  Option @{verbatim "-l"} lists all options with their declaration and
+  current value.
 
   Option @{verbatim "-x"} specifies a file to export the result in
   YXML format, instead of printing it in human-readable form.
--- a/src/Pure/System/options.scala	Tue Oct 29 15:34:29 2013 +0100
+++ b/src/Pure/System/options.scala	Tue Oct 29 16:52:25 2013 +0100
@@ -162,7 +162,10 @@
 {
   override def toString: String = options.iterator.mkString("Options (", ",", ")")
 
-  def print: String = cat_lines(options.toList.sortBy(_._1).map(p => p._2.print))
+  private def print_opt(opt: Options.Opt): String =
+    if (opt.public) "public " + opt.print else opt.print
+
+  def print: String = cat_lines(options.toList.sortBy(_._1).map(p => print_opt(p._2)))
 
   def description(name: String): String = check_name(name).description