File tree Expand file tree Collapse file tree 1 file changed +30
-9
lines changed Expand file tree Collapse file tree 1 file changed +30
-9
lines changed Original file line number Diff line number Diff line change @@ -31,18 +31,39 @@ source "$PROG_HOME/bin/common"
31
31
32
32
CLASS_PATH=" .$PSEP$DOTTY_LIB$PSEP$SCALA_LIB "
33
33
34
- # -d must be the first option
35
- case " $1 " in
36
- -d) DEBUG=" $DEBUG_STR " && shift ;;
37
- esac
38
34
39
- first_arg=" $1 "
35
+ addResidual () {
36
+ residual_args+=(" $1 " )
37
+ }
40
38
41
- if [ -z " $1 " ]; then
39
+ run_repl=true
40
+ run_app=flase
41
+ while [[ $# -gt 0 ]]; do
42
+ key=$1
43
+ case $key in
44
+ -repl)
45
+ run_repl=true
46
+ shift
47
+ ;;
48
+ -classpath)
49
+ CLASS_PATH+=" :$2 "
50
+ shift
51
+ shift
52
+ ;;
53
+ * )
54
+ addResidual " $1 "
55
+ shift
56
+ ;;
57
+ -d)
58
+ DEBUG=" $DEBUG_STR "
59
+ shift
60
+ ;;
61
+ esac
62
+ done
63
+
64
+ if [ -z $residual_args ]; then
42
65
echo " Starting dotty REPL..."
43
66
eval " $PROG_HOME /bin/dotc -repl"
44
- elif [[ ${first_arg: 0: 1} == " -" ]]; then
45
- eval " $PROG_HOME /bin/dotc -repl $@ "
46
67
else
47
- eval exec " \" $JAVACMD \" " " $DEBUG " " -classpath \" $CLASS_PATH \" " $@
68
+ eval exec " \" $JAVACMD \" " " $DEBUG " " -classpath \" $CLASS_PATH \" " " ${residual_args[@]} "
48
69
fi
You can’t perform that action at this time.
0 commit comments