-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTEST
More file actions
executable file
·66 lines (57 loc) · 1.41 KB
/
TEST
File metadata and controls
executable file
·66 lines (57 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/bash
# usage instructions
usage () {
printf "\n"
printf "Usage: $0 [OPTIONS ...] [ESMF_PERFORMANCE_TEST_OPTIONS]\n"
printf "\n"
printf "ESMF_PERFORMANCE_TEST_OPTIONS\n"
printf " ESMF performance test options\n"
printf " (see $0 --help)\n"
printf "\n"
printf "OPTIONS\n"
printf " --show\n"
printf " Show this help message and exit\n"
printf " --env-auto=[ON|OFF]\n"
printf " Disable automatic system dependent environment settings\n"
printf " (default: OFF)\n"
printf "\n"
}
# usage error
usage_error () {
printf "\e[91mERROR: $1 $2\e[0m\n"
usage
exit 1
}
# error
error () {
printf "\e[91mERROR: $1\e[0m\n"
exit 1
}
# load tools
source tools/bashtools.bash
# settings
EPTDIR=$(cd "$(dirname "$(readlink -f -n "${BASH_SOURCE[0]}" )" )" && pwd -P)
ENVDIR=${EPTDIR}/env
SYSTEM=$(find_system)
ENV_AUTO="OFF"
# process arguments
POSITIONAL_ARGS=()
while [[ $# -gt 0 ]]; do
case "$1" in
--show) usage; exit 0 ;;
--env-auto=?*) ENV_AUTO=${1#*=} ;;
--env-auto) usage_error "$1" "requires an argument" ;;
--env-auto=) usage_error "$1" "requires an argument" ;;
*) POSITIONAL_ARGS+=("${1}") ;;
esac
shift
done
set -- "${POSITIONAL_ARGS[@]}"
# set up system dependent environment
case "${ENV_AUTO}" in
ON|on) setup_system ${SYSTEM} ${ENVDIR} ;;
OFF|off) ;;
*) usage_error "--env-auto=${ENV_AUTO}" "unknown option"
esac
set -eu
python3 -m src.esmftk "$@"