lib/Tools/update_sub_sup
author wenzelm
Fri Jan 01 16:40:47 2016 +0100 (2016-01-01)
changeset 62028 2ecee4679f99
parent 52921 0ea2b657eb42
permissions -rwxr-xr-x
updated for release;
wenzelm@52618
     1
#!/usr/bin/env bash
wenzelm@52618
     2
#
wenzelm@52618
     3
# Author: Makarius
wenzelm@52618
     4
#
wenzelm@52921
     5
# DESCRIPTION: update Isabelle symbols involving sub/superscripts
wenzelm@52618
     6
wenzelm@52618
     7
wenzelm@52618
     8
## diagnostics
wenzelm@52618
     9
wenzelm@52618
    10
PRG="$(basename "$0")"
wenzelm@52618
    11
wenzelm@52618
    12
function usage()
wenzelm@52618
    13
{
wenzelm@52618
    14
  echo
wenzelm@52618
    15
  echo "Usage: isabelle $PRG [FILES|DIRS...]"
wenzelm@52618
    16
  echo
wenzelm@52921
    17
  echo "  Recursively find .thy/.ML files and update Isabelle symbols involving"
wenzelm@52618
    18
  echo "  sub- and superscript."
wenzelm@52618
    19
  echo
wenzelm@52618
    20
  echo "  Old versions of files are preserved by appending \"~~\"."
wenzelm@52618
    21
  echo
wenzelm@52618
    22
  exit 1
wenzelm@52618
    23
}
wenzelm@52618
    24
wenzelm@52618
    25
wenzelm@52618
    26
## process command line
wenzelm@52618
    27
wenzelm@52618
    28
[ "$#" -eq 0 -o "$1" = "-?" ] && usage
wenzelm@52618
    29
wenzelm@52618
    30
SPECS="$@"; shift "$#"
wenzelm@52618
    31
wenzelm@52618
    32
wenzelm@52618
    33
## main
wenzelm@52618
    34
wenzelm@52618
    35
find $SPECS \( -name \*.ML -o -name \*.thy \) -print0 | \
wenzelm@52618
    36
  xargs -0 "$ISABELLE_HOME/lib/scripts/update_sub_sup"