lib/Tools/update_sub_sup
author wenzelm
Fri Jul 12 14:54:17 2013 +0200 (2013-07-12)
changeset 52618 2077168aa8f7
child 52921 0ea2b657eb42
permissions -rwxr-xr-x
added "isabelle update_sub_sup" tool;
     1 #!/usr/bin/env bash
     2 #
     3 # Author: Makarius
     4 #
     5 # DESCRIPTION: update sub/sup control symbols
     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/.ML files and update control symbols for"
    18   echo "  sub- and superscript."
    19   echo
    20   echo "  Old versions of files are preserved by appending \"~~\"."
    21   echo
    22   exit 1
    23 }
    24 
    25 
    26 ## process command line
    27 
    28 [ "$#" -eq 0 -o "$1" = "-?" ] && usage
    29 
    30 SPECS="$@"; shift "$#"
    31 
    32 
    33 ## main
    34 
    35 find $SPECS \( -name \*.ML -o -name \*.thy \) -print0 | \
    36   xargs -0 "$ISABELLE_HOME/lib/scripts/update_sub_sup"