lib/Tools/fixheaders
changeset 27206 9a786d5f8821
parent 27205 56c96c02ab79
child 27207 548e2d3105b9
equal deleted inserted replaced
27205:56c96c02ab79 27206:9a786d5f8821
     1 #!/usr/bin/env bash
       
     2 #
       
     3 # $Id$
       
     4 # Author: Florian Haftmann, TUM
       
     5 #
       
     6 # DESCRIPTION: turn Isar theory headers into imports-uses-begin format
       
     7 
       
     8 
       
     9 ## diagnostics
       
    10 
       
    11 PRG="$(basename "$0")"
       
    12 
       
    13 function usage()
       
    14 {
       
    15   echo
       
    16   echo "Usage: $PRG [FILES|DIRS...]"
       
    17   echo
       
    18   echo "  Recursively find .thy files, turning Isar theory headers into"
       
    19   echo "  imports-uses-begin format."
       
    20   echo
       
    21   echo "  Renames old versions of FILES by appending \"~~\"."
       
    22   echo
       
    23   exit 1
       
    24 }
       
    25 
       
    26 
       
    27 ## process command line
       
    28 
       
    29 [ "$#" -eq 0 -o "$1" = "-?" ] && usage
       
    30 
       
    31 SPECS="$@"; shift "$#"
       
    32 
       
    33 
       
    34 ## main
       
    35 
       
    36 find $SPECS -name \*.thy -print | \
       
    37   xargs perl -w "$ISABELLE_HOME/lib/scripts/fixheaders.pl"