lib/Tools/update_sub_sup
changeset 52618 2077168aa8f7
child 52921 0ea2b657eb42
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/lib/Tools/update_sub_sup	Fri Jul 12 14:54:17 2013 +0200
     1.3 @@ -0,0 +1,36 @@
     1.4 +#!/usr/bin/env bash
     1.5 +#
     1.6 +# Author: Makarius
     1.7 +#
     1.8 +# DESCRIPTION: update sub/sup control symbols
     1.9 +
    1.10 +
    1.11 +## diagnostics
    1.12 +
    1.13 +PRG="$(basename "$0")"
    1.14 +
    1.15 +function usage()
    1.16 +{
    1.17 +  echo
    1.18 +  echo "Usage: isabelle $PRG [FILES|DIRS...]"
    1.19 +  echo
    1.20 +  echo "  Recursively find .thy/.ML files and update control symbols for"
    1.21 +  echo "  sub- and superscript."
    1.22 +  echo
    1.23 +  echo "  Old versions of files are preserved by appending \"~~\"."
    1.24 +  echo
    1.25 +  exit 1
    1.26 +}
    1.27 +
    1.28 +
    1.29 +## process command line
    1.30 +
    1.31 +[ "$#" -eq 0 -o "$1" = "-?" ] && usage
    1.32 +
    1.33 +SPECS="$@"; shift "$#"
    1.34 +
    1.35 +
    1.36 +## main
    1.37 +
    1.38 +find $SPECS \( -name \*.ML -o -name \*.thy \) -print0 | \
    1.39 +  xargs -0 "$ISABELLE_HOME/lib/scripts/update_sub_sup"