lib/Tools/update_sub_sup
changeset 62458 9590972c2caf
parent 62457 a3c7bd201da7
parent 62456 11e06f5283bc
child 62461 075ef5ec115c
equal deleted inserted replaced
62457:a3c7bd201da7 62458:9590972c2caf
     1 #!/usr/bin/env bash
       
     2 #
       
     3 # Author: Makarius
       
     4 #
       
     5 # DESCRIPTION: update Isabelle symbols involving sub/superscripts
       
     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 Isabelle symbols involving"
       
    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"