58861
|
1 |
#!/usr/bin/env bash
|
|
2 |
#
|
|
3 |
# Author: Makarius
|
|
4 |
#
|
|
5 |
# DESCRIPTION: remove obsolete semicolons from theory sources
|
|
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 remove obsolete semicolons."
|
|
18 |
echo
|
|
19 |
echo " Old versions of files are preserved by appending \"~~\"."
|
|
20 |
echo
|
|
21 |
exit 1
|
|
22 |
}
|
|
23 |
|
|
24 |
|
|
25 |
## process command line
|
|
26 |
|
|
27 |
[ "$#" -eq 0 -o "$1" = "-?" ] && usage
|
|
28 |
|
|
29 |
SPECS="$@"; shift "$#"
|
|
30 |
|
|
31 |
|
|
32 |
## main
|
|
33 |
|
|
34 |
find $SPECS -name \*.thy -print0 | \
|
|
35 |
xargs -0 "$ISABELLE_TOOL" java isabelle.Update_Semicolons
|