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