lib/Tools/fixheaders
changeset 16471 c487e7e8865f
child 16704 89cc9172f0be
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/Tools/fixheaders	Mon Jun 20 11:30:44 2005 +0200
@@ -0,0 +1,40 @@
+#!/usr/bin/env bash
+#
+# $Id$
+# Author: Florian Haftmann, TUM
+#
+# DESCRIPTION: migrates theory header (of new-style theories) to non-deprecated syntax
+
+
+## diagnostics
+
+PRG="$(basename "$0")"
+
+function usage()
+{
+  echo
+  echo "Usage: $PRG [FILES|DIRS...]"
+  echo
+  echo "  Recursively find .thy files, patching them to ensure that"
+  echo "  theory headers (of new-style theories) are in non-deprecated format."
+  echo
+  echo "  Renames old versions of FILES by appending \"~~\"."
+  echo
+  exit 1
+}
+
+
+## process command line
+
+[ "$#" -eq 0 -o "$1" = "-?" ] && usage
+
+SPECS="$@"; shift "$#"
+
+
+## main
+
+#set by configure
+AUTO_PERL=perl
+
+find $SPECS \( -name \*.thy -o -name \*.ML \) -print | \
+  xargs "$AUTO_PERL" -w "$ISABELLE_HOME/lib/scripts/fixheaders.pl"