author | blanchet |
Tue, 18 Feb 2014 17:52:28 +0100 | |
changeset 55567 | 260e18aa306f |
parent 52443 | 725916b7dee5 |
permissions | -rwxr-xr-x |
24875 | 1 |
#!/usr/bin/env bash |
2 |
# |
|
3 |
# Author: Makarius |
|
4 |
# |
|
52439
4cf3f6153eb8
improved "isabelle keywords" and "isabelle update_keywords" based on Isabelle/Scala, without requiring to build sessions first;
wenzelm
parents:
35022
diff
changeset
|
5 |
# DESCRIPTION: generate keyword files for Emacs Proof General |
24875 | 6 |
|
7 |
||
8 |
## diagnostics |
|
9 |
||
10 |
PRG="$(basename "$0")" |
|
11 |
||
12 |
function usage() |
|
13 |
{ |
|
14 |
echo |
|
52439
4cf3f6153eb8
improved "isabelle keywords" and "isabelle update_keywords" based on Isabelle/Scala, without requiring to build sessions first;
wenzelm
parents:
35022
diff
changeset
|
15 |
echo "Usage: isabelle $PRG [OPTIONS] [SESSIONS ...]" |
24875 | 16 |
echo |
17 |
echo " Options are:" |
|
52439
4cf3f6153eb8
improved "isabelle keywords" and "isabelle update_keywords" based on Isabelle/Scala, without requiring to build sessions first;
wenzelm
parents:
35022
diff
changeset
|
18 |
echo " -d DIR include session directory" |
24875 | 19 |
echo " -k NAME specific name of keywords collection (default: empty)" |
20 |
echo |
|
52439
4cf3f6153eb8
improved "isabelle keywords" and "isabelle update_keywords" based on Isabelle/Scala, without requiring to build sessions first;
wenzelm
parents:
35022
diff
changeset
|
21 |
echo " Generate keyword files for Emacs Proof General from Isabelle sessions." |
24875 | 22 |
echo |
23 |
exit 1 |
|
24 |
} |
|
25 |
||
26 |
||
27 |
## process command line |
|
28 |
||
29 |
# options |
|
30 |
||
52439
4cf3f6153eb8
improved "isabelle keywords" and "isabelle update_keywords" based on Isabelle/Scala, without requiring to build sessions first;
wenzelm
parents:
35022
diff
changeset
|
31 |
declare -a DIRS=() |
24875 | 32 |
KEYWORDS_NAME="" |
33 |
||
52439
4cf3f6153eb8
improved "isabelle keywords" and "isabelle update_keywords" based on Isabelle/Scala, without requiring to build sessions first;
wenzelm
parents:
35022
diff
changeset
|
34 |
while getopts "d:k:" OPT |
24875 | 35 |
do |
36 |
case "$OPT" in |
|
52439
4cf3f6153eb8
improved "isabelle keywords" and "isabelle update_keywords" based on Isabelle/Scala, without requiring to build sessions first;
wenzelm
parents:
35022
diff
changeset
|
37 |
d) |
4cf3f6153eb8
improved "isabelle keywords" and "isabelle update_keywords" based on Isabelle/Scala, without requiring to build sessions first;
wenzelm
parents:
35022
diff
changeset
|
38 |
DIRS["${#DIRS[@]}"]="$OPTARG" |
4cf3f6153eb8
improved "isabelle keywords" and "isabelle update_keywords" based on Isabelle/Scala, without requiring to build sessions first;
wenzelm
parents:
35022
diff
changeset
|
39 |
;; |
24875 | 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 |
||
52443 | 54 |
isabelle_admin_build jars || exit $? |
52439
4cf3f6153eb8
improved "isabelle keywords" and "isabelle update_keywords" based on Isabelle/Scala, without requiring to build sessions first;
wenzelm
parents:
35022
diff
changeset
|
55 |
|
4cf3f6153eb8
improved "isabelle keywords" and "isabelle update_keywords" based on Isabelle/Scala, without requiring to build sessions first;
wenzelm
parents:
35022
diff
changeset
|
56 |
declare -a JAVA_ARGS; eval "JAVA_ARGS=($ISABELLE_BUILD_JAVA_OPTIONS)" |
24875 | 57 |
|
52439
4cf3f6153eb8
improved "isabelle keywords" and "isabelle update_keywords" based on Isabelle/Scala, without requiring to build sessions first;
wenzelm
parents:
35022
diff
changeset
|
58 |
"$ISABELLE_TOOL" java "${JAVA_ARGS[@]}" isabelle.Keywords keywords \ |
4cf3f6153eb8
improved "isabelle keywords" and "isabelle update_keywords" based on Isabelle/Scala, without requiring to build sessions first;
wenzelm
parents:
35022
diff
changeset
|
59 |
"$KEYWORDS_NAME" "${DIRS[@]}" $'\n' "$@" |
4cf3f6153eb8
improved "isabelle keywords" and "isabelle update_keywords" based on Isabelle/Scala, without requiring to build sessions first;
wenzelm
parents:
35022
diff
changeset
|
60 |