Skip to content

Commit f448013

Browse files
author
Rajesh Veeranki
committed
Use Option[String] instead of Array[String] for initialCommands Repl
1 parent f1d9f9c commit f448013

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

compiler/src/dotty/tools/repl/ReplDriver.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ case class Completions(cursor: Int,
7878
class ReplDriver(settings: Array[String],
7979
protected val out: PrintStream = System.out,
8080
protected val classLoader: Option[ClassLoader] = None,
81-
initialCommands: Array[String] = Array.empty,
82-
cleanupCommands: Array[String] = Array.empty) extends Driver {
81+
initialCommands: Option[String] = None,
82+
cleanupCommands: Option[String] = None) extends Driver {
8383

8484
/** Overridden to `false` in order to not have to give sources on the
8585
* commandline
@@ -153,7 +153,7 @@ class ReplDriver(settings: Array[String],
153153
final def run(res: ParseResult)(implicit state: State): State =
154154
interpret(res)
155155

156-
final def runBootstrapCommands(cmds: Array[String])(implicit state: State): State = {
156+
final def runBootstrapCommands(cmds: Option[String])(implicit state: State): State = {
157157
cmds.map(ParseResult.apply(_)(rootCtx)).map(Silent.apply(_)).foldLeft(state) { (s, cmd) =>
158158
interpret(cmd)(s)
159159
}

sbt-bridge/src/xsbt/ConsoleInterface.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ class ConsoleInterface {
1919
def run(args: Array[String],
2020
bootClasspathString: String,
2121
classpathString: String,
22-
initialCommands: Array[String],
23-
cleanupCommands: Array[String],
22+
initialCommands: String,
23+
cleanupCommands: String,
2424
loader: ClassLoader,
2525
bindNames: Array[String],
2626
bindValues: Array[Any],
@@ -33,6 +33,6 @@ class ConsoleInterface {
3333
} ++
3434
Array("-classpath", classpathString)
3535

36-
new ReplDriver(completeArgs, classLoader = Some(loader), initialCommands = initialCommands, cleanupCommands = cleanupCommands).runUntilQuit()
36+
new ReplDriver(completeArgs, classLoader = Some(loader), initialCommands = Some(initialCommands), cleanupCommands = Some(cleanupCommands)).runUntilQuit()
3737
}
3838
}

0 commit comments

Comments
 (0)