lib/Tools/options
changeset 48693 ceeea46bdeba
child 50531 f841ac0cb757
equal deleted inserted replaced
48692:90e5093c3e1c 48693:ceeea46bdeba
       
     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"
       
    19   echo "    -x FILE      export to FILE in YXML format"
       
    20   echo
       
    21   echo "  Print Isabelle system options, augmented by MORE_OPTIONS given as"
       
    22   echo "  arguments NAME=VAL or NAME."
       
    23   echo
       
    24   exit 1
       
    25 }
       
    26 
       
    27 function fail()
       
    28 {
       
    29   echo "$1" >&2
       
    30   exit 2
       
    31 }
       
    32 
       
    33 
       
    34 ## process command line
       
    35 
       
    36 eval "declare -a BUILD_OPTIONS=()"
       
    37 EXPORT_FILE=""
       
    38 
       
    39 while getopts "bx:" OPT
       
    40 do
       
    41   case "$OPT" in
       
    42     b)
       
    43       BUILD_OPTIONS=($ISABELLE_BUILD_OPTIONS)
       
    44       ;;
       
    45     x)
       
    46       EXPORT_FILE="$OPTARG"
       
    47       ;;
       
    48     \?)
       
    49       usage
       
    50       ;;
       
    51   esac
       
    52 done
       
    53 
       
    54 shift $(($OPTIND - 1))
       
    55 
       
    56 
       
    57 ## main
       
    58 
       
    59 [ -e "$ISABELLE_HOME/Admin/build" ] && { "$ISABELLE_HOME/Admin/build" jars || exit $?; }
       
    60 
       
    61 exec "$ISABELLE_TOOL" java isabelle.Options "$EXPORT_FILE" "${BUILD_OPTIONS[@]}" "$@"
       
    62