lib/Tools/update_sub_sup
author wenzelm
Sat, 13 Jul 2013 21:02:41 +0200
changeset 52653 0589394aaaa5
parent 52618 2077168aa8f7
child 52921 0ea2b657eb42
permissions -rwxr-xr-x
merged
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
#
2077168aa8f7 added "isabelle update_sub_sup" tool;
wenzelm
parents:
diff changeset
     5
# DESCRIPTION: update sub/sup control symbols
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
2077168aa8f7 added "isabelle update_sub_sup" tool;
wenzelm
parents:
diff changeset
    17
  echo "  Recursively find .thy/.ML files and update control symbols for"
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"