16471
|
1 |
#!/usr/bin/env bash
|
|
2 |
#
|
|
3 |
# $Id$
|
|
4 |
# Author: Florian Haftmann, TUM
|
|
5 |
#
|
16704
|
6 |
# DESCRIPTION: turn Isar theory headers into imports-uses-begin format
|
16471
|
7 |
|
|
8 |
|
|
9 |
## diagnostics
|
|
10 |
|
|
11 |
PRG="$(basename "$0")"
|
|
12 |
|
|
13 |
function usage()
|
|
14 |
{
|
|
15 |
echo
|
|
16 |
echo "Usage: $PRG [FILES|DIRS...]"
|
|
17 |
echo
|
16704
|
18 |
echo " Recursively find .thy files, turning Isar theory headers into"
|
|
19 |
echo " imports-uses-begin format."
|
16471
|
20 |
echo
|
|
21 |
echo " Renames old versions of FILES by appending \"~~\"."
|
|
22 |
echo
|
|
23 |
exit 1
|
|
24 |
}
|
|
25 |
|
|
26 |
|
|
27 |
## process command line
|
|
28 |
|
|
29 |
[ "$#" -eq 0 -o "$1" = "-?" ] && usage
|
|
30 |
|
|
31 |
SPECS="$@"; shift "$#"
|
|
32 |
|
|
33 |
|
|
34 |
## main
|
|
35 |
|
|
36 |
#set by configure
|
|
37 |
AUTO_PERL=perl
|
|
38 |
|
16704
|
39 |
find $SPECS -name \*.thy -print | \
|
16471
|
40 |
xargs "$AUTO_PERL" -w "$ISABELLE_HOME/lib/scripts/fixheaders.pl"
|