author | nipkow |
Fri, 08 Aug 2014 08:26:32 +0200 | |
changeset 57817 | dfebc374bd89 |
parent 52735 | 842b5e7dcac8 |
child 62437 | bccad0374407 |
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" |
|
52735 | 19 |
echo " -g OPTION get value of OPTION" |
50531
f841ac0cb757
clarified "isabelle options" command line, to make it more close to "isabelle components";
wenzelm
parents:
48693
diff
changeset
|
20 |
echo " -l list options" |
f841ac0cb757
clarified "isabelle options" command line, to make it more close to "isabelle components";
wenzelm
parents:
48693
diff
changeset
|
21 |
echo " -x FILE export options to FILE in YXML format" |
48693 | 22 |
echo |
50531
f841ac0cb757
clarified "isabelle options" command line, to make it more close to "isabelle components";
wenzelm
parents:
48693
diff
changeset
|
23 |
echo " Report Isabelle system options, augmented by MORE_OPTIONS given as" |
48693 | 24 |
echo " arguments NAME=VAL or NAME." |
25 |
echo |
|
26 |
exit 1 |
|
27 |
} |
|
28 |
||
29 |
function fail() |
|
30 |
{ |
|
31 |
echo "$1" >&2 |
|
32 |
exit 2 |
|
33 |
} |
|
34 |
||
35 |
||
36 |
## process command line |
|
37 |
||
52055 | 38 |
declare -a BUILD_OPTIONS=() |
52735 | 39 |
GET_OPTION="" |
50531
f841ac0cb757
clarified "isabelle options" command line, to make it more close to "isabelle components";
wenzelm
parents:
48693
diff
changeset
|
40 |
LIST_OPTIONS="false" |
48693 | 41 |
EXPORT_FILE="" |
42 |
||
52735 | 43 |
while getopts "bg:lx:" OPT |
48693 | 44 |
do |
45 |
case "$OPT" in |
|
46 |
b) |
|
52055 | 47 |
eval "BUILD_OPTIONS=($ISABELLE_BUILD_OPTIONS)" |
48693 | 48 |
;; |
52735 | 49 |
g) |
50 |
GET_OPTION="$OPTARG" |
|
51 |
;; |
|
50531
f841ac0cb757
clarified "isabelle options" command line, to make it more close to "isabelle components";
wenzelm
parents:
48693
diff
changeset
|
52 |
l) |
f841ac0cb757
clarified "isabelle options" command line, to make it more close to "isabelle components";
wenzelm
parents:
48693
diff
changeset
|
53 |
LIST_OPTIONS="true" |
f841ac0cb757
clarified "isabelle options" command line, to make it more close to "isabelle components";
wenzelm
parents:
48693
diff
changeset
|
54 |
;; |
48693 | 55 |
x) |
56 |
EXPORT_FILE="$OPTARG" |
|
57 |
;; |
|
58 |
\?) |
|
59 |
usage |
|
60 |
;; |
|
61 |
esac |
|
62 |
done |
|
63 |
||
64 |
shift $(($OPTIND - 1)) |
|
65 |
||
52735 | 66 |
[ -z "$GET_OPTION" -a "$LIST_OPTIONS" = "false" -a -z "$EXPORT_FILE" ] && usage |
50531
f841ac0cb757
clarified "isabelle options" command line, to make it more close to "isabelle components";
wenzelm
parents:
48693
diff
changeset
|
67 |
|
48693 | 68 |
|
69 |
## main |
|
70 |
||
52443 | 71 |
isabelle_admin_build jars || exit $? |
48693 | 72 |
|
52735 | 73 |
exec "$ISABELLE_TOOL" java isabelle.Options \ |
74 |
"$GET_OPTION" "$EXPORT_FILE" "${BUILD_OPTIONS[@]}" "$@" |
|
48693 | 75 |