lib/Tools/update_sub_sup
author Lars Hupel <lars.hupel@mytum.de>
Thu, 06 Mar 2014 17:55:39 +0100
changeset 55946 5163ed3a38f5
parent 52921 0ea2b657eb42
permissions -rwxr-xr-x
tuned
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
52618
2077168aa8f7 added "isabelle update_sub_sup" tool;
wenzelm
parents:
diff changeset
     1
#!/usr/bin/env bash
2077168aa8f7 added "isabelle update_sub_sup" tool;
wenzelm
parents:
diff changeset
     2
#
2077168aa8f7 added "isabelle update_sub_sup" tool;
wenzelm
parents:
diff changeset
     3
# Author: Makarius
2077168aa8f7 added "isabelle update_sub_sup" tool;
wenzelm
parents:
diff changeset
     4
#
52921
0ea2b657eb42 eliminate \<twosuperior> as well;
wenzelm
parents: 52618
diff changeset
     5
# DESCRIPTION: update Isabelle symbols involving sub/superscripts
52618
2077168aa8f7 added "isabelle update_sub_sup" tool;
wenzelm
parents:
diff changeset
     6
2077168aa8f7 added "isabelle update_sub_sup" tool;
wenzelm
parents:
diff changeset
     7
2077168aa8f7 added "isabelle update_sub_sup" tool;
wenzelm
parents:
diff changeset
     8
## diagnostics
2077168aa8f7 added "isabelle update_sub_sup" tool;
wenzelm
parents:
diff changeset
     9
2077168aa8f7 added "isabelle update_sub_sup" tool;
wenzelm
parents:
diff changeset
    10
PRG="$(basename "$0")"
2077168aa8f7 added "isabelle update_sub_sup" tool;
wenzelm
parents:
diff changeset
    11
2077168aa8f7 added "isabelle update_sub_sup" tool;
wenzelm
parents:
diff changeset
    12
function usage()
2077168aa8f7 added "isabelle update_sub_sup" tool;
wenzelm
parents:
diff changeset
    13
{
2077168aa8f7 added "isabelle update_sub_sup" tool;
wenzelm
parents:
diff changeset
    14
  echo
2077168aa8f7 added "isabelle update_sub_sup" tool;
wenzelm
parents:
diff changeset
    15
  echo "Usage: isabelle $PRG [FILES|DIRS...]"
2077168aa8f7 added "isabelle update_sub_sup" tool;
wenzelm
parents:
diff changeset
    16
  echo
52921
0ea2b657eb42 eliminate \<twosuperior> as well;
wenzelm
parents: 52618
diff changeset
    17
  echo "  Recursively find .thy/.ML files and update Isabelle symbols involving"
52618
2077168aa8f7 added "isabelle update_sub_sup" tool;
wenzelm
parents:
diff changeset
    18
  echo "  sub- and superscript."
2077168aa8f7 added "isabelle update_sub_sup" tool;
wenzelm
parents:
diff changeset
    19
  echo
2077168aa8f7 added "isabelle update_sub_sup" tool;
wenzelm
parents:
diff changeset
    20
  echo "  Old versions of files are preserved by appending \"~~\"."
2077168aa8f7 added "isabelle update_sub_sup" tool;
wenzelm
parents:
diff changeset
    21
  echo
2077168aa8f7 added "isabelle update_sub_sup" tool;
wenzelm
parents:
diff changeset
    22
  exit 1
2077168aa8f7 added "isabelle update_sub_sup" tool;
wenzelm
parents:
diff changeset
    23
}
2077168aa8f7 added "isabelle update_sub_sup" tool;
wenzelm
parents:
diff changeset
    24
2077168aa8f7 added "isabelle update_sub_sup" tool;
wenzelm
parents:
diff changeset
    25
2077168aa8f7 added "isabelle update_sub_sup" tool;
wenzelm
parents:
diff changeset
    26
## process command line
2077168aa8f7 added "isabelle update_sub_sup" tool;
wenzelm
parents:
diff changeset
    27
2077168aa8f7 added "isabelle update_sub_sup" tool;
wenzelm
parents:
diff changeset
    28
[ "$#" -eq 0 -o "$1" = "-?" ] && usage
2077168aa8f7 added "isabelle update_sub_sup" tool;
wenzelm
parents:
diff changeset
    29
2077168aa8f7 added "isabelle update_sub_sup" tool;
wenzelm
parents:
diff changeset
    30
SPECS="$@"; shift "$#"
2077168aa8f7 added "isabelle update_sub_sup" tool;
wenzelm
parents:
diff changeset
    31
2077168aa8f7 added "isabelle update_sub_sup" tool;
wenzelm
parents:
diff changeset
    32
2077168aa8f7 added "isabelle update_sub_sup" tool;
wenzelm
parents:
diff changeset
    33
## main
2077168aa8f7 added "isabelle update_sub_sup" tool;
wenzelm
parents:
diff changeset
    34
2077168aa8f7 added "isabelle update_sub_sup" tool;
wenzelm
parents:
diff changeset
    35
find $SPECS \( -name \*.ML -o -name \*.thy \) -print0 | \
2077168aa8f7 added "isabelle update_sub_sup" tool;
wenzelm
parents:
diff changeset
    36
  xargs -0 "$ISABELLE_HOME/lib/scripts/update_sub_sup"