author | wenzelm |
Fri, 17 May 2013 18:50:55 +0200 | |
changeset 52055 | 10bc73197a57 |
parent 50531 | f841ac0cb757 |
child 52443 | 725916b7dee5 |
permissions | -rwxr-xr-x |
48693 | 1 |
#!/usr/bin/env bash |
2 |
# |
|
3 |
# Author: Makarius |
|
4 |
# |
|
5 |
# DESCRIPTION: print Isabelle system options |
|
6 |
||
7 |
||
8 |
## diagnostics |
|
9 |
||
10 |
PRG="$(basename "$0")" |
|
11 |
||
12 |
function usage() |
|
13 |
{ |
|
14 |
echo |
|
15 |
echo "Usage: isabelle $PRG [OPTIONS] [MORE_OPTIONS ...]" |
|
16 |
echo |
|
17 |
echo " Options are:" |
|
18 |
echo " -b include \$ISABELLE_BUILD_OPTIONS" |
|
50531
f841ac0cb757
clarified "isabelle options" command line, to make it more close to "isabelle components";
wenzelm
parents:
48693
diff
changeset
|
19 |
echo " -l list options" |
f841ac0cb757
clarified "isabelle options" command line, to make it more close to "isabelle components";
wenzelm
parents:
48693
diff
changeset
|
20 |
echo " -x FILE export options to FILE in YXML format" |
48693 | 21 |
echo |
50531
f841ac0cb757
clarified "isabelle options" command line, to make it more close to "isabelle components";
wenzelm
parents:
48693
diff
changeset
|
22 |
echo " Report Isabelle system options, augmented by MORE_OPTIONS given as" |
48693 | 23 |
echo " arguments NAME=VAL or NAME." |
24 |
echo |
|
25 |
exit 1 |
|
26 |
} |
|
27 |
||
28 |
function fail() |
|
29 |
{ |
|
30 |
echo "$1" >&2 |
|
31 |
exit 2 |
|
32 |
} |
|
33 |
||
34 |
||
35 |
## process command line |
|
36 |
||
52055 | 37 |
declare -a BUILD_OPTIONS=() |
50531
f841ac0cb757
clarified "isabelle options" command line, to make it more close to "isabelle components";
wenzelm
parents:
48693
diff
changeset
|
38 |
LIST_OPTIONS="false" |
48693 | 39 |
EXPORT_FILE="" |
40 |
||
50531
f841ac0cb757
clarified "isabelle options" command line, to make it more close to "isabelle components";
wenzelm
parents:
48693
diff
changeset
|
41 |
while getopts "blx:" OPT |
48693 | 42 |
do |
43 |
case "$OPT" in |
|
44 |
b) |
|
52055 | 45 |
eval "BUILD_OPTIONS=($ISABELLE_BUILD_OPTIONS)" |
48693 | 46 |
;; |
50531
f841ac0cb757
clarified "isabelle options" command line, to make it more close to "isabelle components";
wenzelm
parents:
48693
diff
changeset
|
47 |
l) |
f841ac0cb757
clarified "isabelle options" command line, to make it more close to "isabelle components";
wenzelm
parents:
48693
diff
changeset
|
48 |
LIST_OPTIONS="true" |
f841ac0cb757
clarified "isabelle options" command line, to make it more close to "isabelle components";
wenzelm
parents:
48693
diff
changeset
|
49 |
;; |
48693 | 50 |
x) |
51 |
EXPORT_FILE="$OPTARG" |
|
52 |
;; |
|
53 |
\?) |
|
54 |
usage |
|
55 |
;; |
|
56 |
esac |
|
57 |
done |
|
58 |
||
59 |
shift $(($OPTIND - 1)) |
|
60 |
||
50531
f841ac0cb757
clarified "isabelle options" command line, to make it more close to "isabelle components";
wenzelm
parents:
48693
diff
changeset
|
61 |
[ "$LIST_OPTIONS" = "false" -a -z "$EXPORT_FILE" ] && usage |
f841ac0cb757
clarified "isabelle options" command line, to make it more close to "isabelle components";
wenzelm
parents:
48693
diff
changeset
|
62 |
|
48693 | 63 |
|
64 |
## main |
|
65 |
||
66 |
[ -e "$ISABELLE_HOME/Admin/build" ] && { "$ISABELLE_HOME/Admin/build" jars || exit $?; } |
|
67 |
||
68 |
exec "$ISABELLE_TOOL" java isabelle.Options "$EXPORT_FILE" "${BUILD_OPTIONS[@]}" "$@" |
|
69 |