lib/Tools/keywords
author wenzelm
Sat, 02 Aug 2014 19:29:02 +0200
changeset 57843 d8966c09025c
parent 52443 725916b7dee5
permissions -rwxr-xr-x
proper priority for error over warning also for node_status (see 9c5220e05e04);

#!/usr/bin/env bash
#
# Author: Makarius
#
# DESCRIPTION: generate keyword files for Emacs Proof General


## diagnostics

PRG="$(basename "$0")"

function usage()
{
  echo
  echo "Usage: isabelle $PRG [OPTIONS] [SESSIONS ...]"
  echo
  echo "  Options are:"
  echo "    -d DIR       include session directory"
  echo "    -k NAME      specific name of keywords collection (default: empty)"
  echo
  echo "  Generate keyword files for Emacs Proof General from Isabelle sessions."
  echo
  exit 1
}


## process command line

# options

declare -a DIRS=()
KEYWORDS_NAME=""

while getopts "d:k:" OPT
do
  case "$OPT" in
    d)
      DIRS["${#DIRS[@]}"]="$OPTARG"
      ;;
    k)
      KEYWORDS_NAME="$OPTARG"
      ;;
    \?)
      usage
      ;;
  esac
done

shift $(($OPTIND - 1))


## main

isabelle_admin_build jars || exit $?

declare -a JAVA_ARGS; eval "JAVA_ARGS=($ISABELLE_BUILD_JAVA_OPTIONS)"

"$ISABELLE_TOOL" java "${JAVA_ARGS[@]}" isabelle.Keywords keywords \
  "$KEYWORDS_NAME" "${DIRS[@]}" $'\n' "$@"