src/Pure/Tools/update_then.scala
changeset 62449 1785cbadd226
parent 61216 4ca490f09ec6
child 62454 38c89353b349
--- a/src/Pure/Tools/update_then.scala	Sun Feb 28 15:21:08 2016 +0100
+++ b/src/Pure/Tools/update_then.scala	Sun Feb 28 15:26:09 2016 +0100
@@ -33,7 +33,24 @@
   def main(args: Array[String])
   {
     Command_Line.tool0 {
-      args.foreach(arg => update_then(Path.explode(arg)))
+      val getopts = Getopts(() => """
+Usage: isabelle update_then [FILES|DIRS...]
+
+  Recursively find .thy files and expand old Isar command conflations:
+
+    hence  ~>  then have
+    thus   ~>  then show
+
+  Old versions of files are preserved by appending "~~".
+""")
+
+      val specs = getopts(args)
+      if (specs.isEmpty) getopts.usage()
+
+      for {
+        spec <- specs
+        file <- File.find_files(Path.explode(spec).file, file => file.getName.endsWith(".thy"))
+      } update_then(Path.explode(File.standard_path(file)))
     }
   }
 }