lib/Tools/update_semicolons
author paulson <lp15@cam.ac.uk>
Thu, 25 Feb 2016 13:58:48 +0000
changeset 62408 86f27b264d3d
parent 58861 5ff61774df11
permissions -rwxr-xr-x
Conformal_mappings: a big development in complex analysis (+ some lemmas)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
58861
5ff61774df11 command-line terminator ";" is no longer accepted;
wenzelm
parents:
diff changeset
     1
#!/usr/bin/env bash
5ff61774df11 command-line terminator ";" is no longer accepted;
wenzelm
parents:
diff changeset
     2
#
5ff61774df11 command-line terminator ";" is no longer accepted;
wenzelm
parents:
diff changeset
     3
# Author: Makarius
5ff61774df11 command-line terminator ";" is no longer accepted;
wenzelm
parents:
diff changeset
     4
#
5ff61774df11 command-line terminator ";" is no longer accepted;
wenzelm
parents:
diff changeset
     5
# DESCRIPTION: remove obsolete semicolons from theory sources
5ff61774df11 command-line terminator ";" is no longer accepted;
wenzelm
parents:
diff changeset
     6
5ff61774df11 command-line terminator ";" is no longer accepted;
wenzelm
parents:
diff changeset
     7
5ff61774df11 command-line terminator ";" is no longer accepted;
wenzelm
parents:
diff changeset
     8
## diagnostics
5ff61774df11 command-line terminator ";" is no longer accepted;
wenzelm
parents:
diff changeset
     9
5ff61774df11 command-line terminator ";" is no longer accepted;
wenzelm
parents:
diff changeset
    10
PRG="$(basename "$0")"
5ff61774df11 command-line terminator ";" is no longer accepted;
wenzelm
parents:
diff changeset
    11
5ff61774df11 command-line terminator ";" is no longer accepted;
wenzelm
parents:
diff changeset
    12
function usage()
5ff61774df11 command-line terminator ";" is no longer accepted;
wenzelm
parents:
diff changeset
    13
{
5ff61774df11 command-line terminator ";" is no longer accepted;
wenzelm
parents:
diff changeset
    14
  echo
5ff61774df11 command-line terminator ";" is no longer accepted;
wenzelm
parents:
diff changeset
    15
  echo "Usage: isabelle $PRG [FILES|DIRS...]"
5ff61774df11 command-line terminator ";" is no longer accepted;
wenzelm
parents:
diff changeset
    16
  echo
5ff61774df11 command-line terminator ";" is no longer accepted;
wenzelm
parents:
diff changeset
    17
  echo "  Recursively find .thy files and remove obsolete semicolons."
5ff61774df11 command-line terminator ";" is no longer accepted;
wenzelm
parents:
diff changeset
    18
  echo
5ff61774df11 command-line terminator ";" is no longer accepted;
wenzelm
parents:
diff changeset
    19
  echo "  Old versions of files are preserved by appending \"~~\"."
5ff61774df11 command-line terminator ";" is no longer accepted;
wenzelm
parents:
diff changeset
    20
  echo
5ff61774df11 command-line terminator ";" is no longer accepted;
wenzelm
parents:
diff changeset
    21
  exit 1
5ff61774df11 command-line terminator ";" is no longer accepted;
wenzelm
parents:
diff changeset
    22
}
5ff61774df11 command-line terminator ";" is no longer accepted;
wenzelm
parents:
diff changeset
    23
5ff61774df11 command-line terminator ";" is no longer accepted;
wenzelm
parents:
diff changeset
    24
5ff61774df11 command-line terminator ";" is no longer accepted;
wenzelm
parents:
diff changeset
    25
## process command line
5ff61774df11 command-line terminator ";" is no longer accepted;
wenzelm
parents:
diff changeset
    26
5ff61774df11 command-line terminator ";" is no longer accepted;
wenzelm
parents:
diff changeset
    27
[ "$#" -eq 0 -o "$1" = "-?" ] && usage
5ff61774df11 command-line terminator ";" is no longer accepted;
wenzelm
parents:
diff changeset
    28
5ff61774df11 command-line terminator ";" is no longer accepted;
wenzelm
parents:
diff changeset
    29
SPECS="$@"; shift "$#"
5ff61774df11 command-line terminator ";" is no longer accepted;
wenzelm
parents:
diff changeset
    30
5ff61774df11 command-line terminator ";" is no longer accepted;
wenzelm
parents:
diff changeset
    31
5ff61774df11 command-line terminator ";" is no longer accepted;
wenzelm
parents:
diff changeset
    32
## main
5ff61774df11 command-line terminator ";" is no longer accepted;
wenzelm
parents:
diff changeset
    33
5ff61774df11 command-line terminator ";" is no longer accepted;
wenzelm
parents:
diff changeset
    34
find $SPECS -name \*.thy -print0 | \
5ff61774df11 command-line terminator ";" is no longer accepted;
wenzelm
parents:
diff changeset
    35
  xargs -0 "$ISABELLE_TOOL" java isabelle.Update_Semicolons