61216
|
1 |
#!/usr/bin/env bash
|
|
2 |
#
|
|
3 |
# Author: Makarius
|
|
4 |
#
|
|
5 |
# DESCRIPTION: expand old Isar command conflations 'hence' and 'thus'
|
|
6 |
|
|
7 |
|
|
8 |
## diagnostics
|
|
9 |
|
|
10 |
PRG="$(basename "$0")"
|
|
11 |
|
|
12 |
function usage()
|
|
13 |
{
|
|
14 |
echo
|
|
15 |
echo "Usage: isabelle $PRG [FILES|DIRS...]"
|
|
16 |
echo
|
|
17 |
echo " Recursively find .thy files and expand old Isar command conflations:"
|
|
18 |
echo
|
|
19 |
echo " hence ~> then have"
|
|
20 |
echo " thus ~> then show"
|
|
21 |
echo
|
|
22 |
echo " Old versions of files are preserved by appending \"~~\"."
|
|
23 |
echo
|
|
24 |
exit 1
|
|
25 |
}
|
|
26 |
|
|
27 |
|
|
28 |
## process command line
|
|
29 |
|
|
30 |
[ "$#" -eq 0 -o "$1" = "-?" ] && usage
|
|
31 |
|
|
32 |
SPECS="$@"; shift "$#"
|
|
33 |
|
|
34 |
|
|
35 |
## main
|
|
36 |
|
|
37 |
find $SPECS -name \*.thy -print0 | \
|
|
38 |
xargs -0 "$ISABELLE_TOOL" java isabelle.Update_Then
|