lib/Tools/keywords
author blanchet
Wed May 21 14:09:42 2014 +0200 (2014-05-21)
changeset 57037 c51132be8e16
parent 52443 725916b7dee5
permissions -rwxr-xr-x
avoid markup-generating @{make_string}
     1 #!/usr/bin/env bash
     2 #
     3 # Author: Makarius
     4 #
     5 # DESCRIPTION: generate keyword files for Emacs Proof General
     6 
     7 
     8 ## diagnostics
     9 
    10 PRG="$(basename "$0")"
    11 
    12 function usage()
    13 {
    14   echo
    15   echo "Usage: isabelle $PRG [OPTIONS] [SESSIONS ...]"
    16   echo
    17   echo "  Options are:"
    18   echo "    -d DIR       include session directory"
    19   echo "    -k NAME      specific name of keywords collection (default: empty)"
    20   echo
    21   echo "  Generate keyword files for Emacs Proof General from Isabelle sessions."
    22   echo
    23   exit 1
    24 }
    25 
    26 
    27 ## process command line
    28 
    29 # options
    30 
    31 declare -a DIRS=()
    32 KEYWORDS_NAME=""
    33 
    34 while getopts "d:k:" OPT
    35 do
    36   case "$OPT" in
    37     d)
    38       DIRS["${#DIRS[@]}"]="$OPTARG"
    39       ;;
    40     k)
    41       KEYWORDS_NAME="$OPTARG"
    42       ;;
    43     \?)
    44       usage
    45       ;;
    46   esac
    47 done
    48 
    49 shift $(($OPTIND - 1))
    50 
    51 
    52 ## main
    53 
    54 isabelle_admin_build jars || exit $?
    55 
    56 declare -a JAVA_ARGS; eval "JAVA_ARGS=($ISABELLE_BUILD_JAVA_OPTIONS)"
    57 
    58 "$ISABELLE_TOOL" java "${JAVA_ARGS[@]}" isabelle.Keywords keywords \
    59   "$KEYWORDS_NAME" "${DIRS[@]}" $'\n' "$@"
    60