Skip to content

Commit 1a0bb90

Browse files
committed
Rename variables and fix comment
1 parent 9410142 commit 1a0bb90

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

dist/bin/dotc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ case "$1" in
9292
-no-colors) unset colors && shift ;;
9393
-with-compiler) jvm_cp_args="$PSEP$DOTTY_COMP" && shift ;;
9494

95-
# break out -D and -J options and add them to JAVA_OPTS as well
96-
# so they reach the JVM in time to do some good. The -D options
95+
# break out -D and -J options and add them to java_args so
96+
# they reach the JVM in time to do some good. The -D options
9797
# will be available as system properties.
9898
-D*) addJava "$1" && shift ;;
9999
-J*) addJava "${1:2}" && shift ;;

dist/bin/dotr

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ addJvmOptions () {
3131
jvm_options+=("$1")
3232
}
3333

34-
addRawJvmOptions () {
34+
addDotcOptions () {
3535
java_options+=("$1")
3636
}
3737

@@ -47,7 +47,8 @@ CLASS_PATH=""
4747
# Little hack to check if all arguments are options
4848
all_params="$*"
4949
truncated_params="${*#-}"
50-
not_only_options=$(( ${#all_params} - ${#truncated_params} - $# ))
50+
# options_indicator != 0 if at least one parameter is not an option
51+
options_indicator=$(( ${#all_params} - ${#truncated_params} - $# ))
5152

5253
while [[ $# -gt 0 ]]; do
5354
case "$1" in
@@ -75,7 +76,7 @@ while [[ $# -gt 0 ]]; do
7576
;;
7677
-J*)
7778
addJvmOptions "${1:2}"
78-
addRawJvmOptions "${1}"
79+
addDotcOptions "${1}"
7980
shift ;;
8081
*)
8182
residual_args+=("$1")
@@ -84,7 +85,7 @@ while [[ $# -gt 0 ]]; do
8485

8586
esac
8687
done
87-
if [ $execute_repl == true ] || ([ $execute_run == false ] && [ $not_only_options == 0 ]); then
88+
if [ $execute_repl == true ] || ([ $execute_run == false ] && [ $options_indicator == 0 ]); then
8889
if [ "$CLASS_PATH" ]; then
8990
cp_arg="-classpath \"$CLASS_PATH\""
9091
fi

0 commit comments

Comments
 (0)