Skip to content

Commit efc41eb

Browse files
authored
use -- to differentiate jvm/class options (#608)
1 parent 0841d5f commit efc41eb

2 files changed

Lines changed: 19 additions & 4 deletions

File tree

bin/recon-util

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
22

33
. `dirname $0`/../libexec/env.sh
44

5+
split_cli $@
6+
57
export MALLOC_ARENA_MAX=1
68

7-
java -Xmx1536m -Xms1024m -XX:+UseSerialGC \
9+
java -Xmx1536m -Xms1024m -XX:+UseSerialGC ${jvm_options[@]} \
810
-cp "$CLAS12DIR/lib/clas/*:$CLAS12DIR/lib/services/*:$CLAS12DIR/lib/utils/*" \
911
org.jlab.clas.reco.EngineProcessor \
10-
$*
12+
${class_options[@]}
13+

libexec/env.sh

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#!/bin/bash
22

3-
CLAS12DIR=$(cd $(dirname ${BASH_SOURCE[0]:-$0})/.. && pwd -P)
4-
export CLAS12DIR
3+
export CLAS12DIR=$(cd $(dirname ${BASH_SOURCE[0]:-$0})/.. && pwd -P)
54

65
# Set default field maps (but do not override user's env):
76
if [ -z "${COAT_MAGFIELD_TORUSMAP-}" ]; then
@@ -37,3 +36,16 @@ if [ $# -ge 1 ]; then
3736

3837
fi
3938
fi
39+
40+
function split_cli {
41+
jvm_options=()
42+
class_options=()
43+
while [[ $# -gt 0 ]]
44+
do
45+
case $1 in
46+
--) shift && jvm_options=("${@}") && break ;;
47+
*) class_options+=($1) && shift ;;
48+
esac
49+
done
50+
}
51+

0 commit comments

Comments
 (0)