-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathparse-args.sh
More file actions
55 lines (51 loc) · 1.29 KB
/
parse-args.sh
File metadata and controls
55 lines (51 loc) · 1.29 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
CLEAN="--clean"
BIG_DIR="${BIG_DIR:=|tmp:///repo/|}"
EXTRA_ARGS=""
RASCAL_JAR=""
function printHelp() {
echo -e "Available: "
echo -e "\t-f\t\tDo not remove existing tpls"
echo -e "\t-s\t\tEverything on source path, no lib dependencies"
echo -e "\t-d <loc>\tOverride location where the repositories are stored and checked"
echo -e "\t-r <path>\tOverride path of which rascal to use (should be a jar) (not a rascal loc, but an absolute regular path)"
echo -e "\t-c <loc>\tOverride location of which rascal-core to use"
echo -e "\t-t <loc>\tOverride location of which typepal to use"
echo -e "\t-h\t\tThis help"
}
while getopts ":hsfd:r:c:t:" opt; do
case ${opt} in
f)
CLEAN=""
;;
d)
BIG_DIR="${OPTARG}"
;;
r)
EXTRA_ARGS+="--rascalVersion |file:///${OPTARG}| "
RASCAL_JAR="${OPTARG}"
;;
c)
EXTRA_ARGS+="--rascalCoreVersion ${OPTARG} "
;;
t)
EXTRA_ARGS+="--typepalVersion ${OPTARG} "
;;
s)
EXTRA_ARGS+="--libs false "
;;
h)
printHelp
exit 0
;;
*)
echo -e "Invalid option: -${OPTARG} ."
printHelp
exit 1
;;
esac
done
shift $(expr $OPTIND - 1 )
if [ "$RASCAL_JAR" -eq "" ]; then
echo "Missing rascal.jar, please provide rascal jar via -r"
exit 1
fi