I can’t get the option to work; am i doing something wrong?
$ scala repl -S 3.6.4-RC1 --repl-init-script 'println("Hello")'
Unrecognized argument: --repl-init-script
To list all available options, run
scala repl --help
But it works inside the repl:
bjornr@bjornux:~$ scala repl -S 3.6.4-RC1
Welcome to Scala 3.6.4-RC1 (21.0.5, Java OpenJDK 64-Bit Server VM).
Type in expressions for evaluation. Or try :help.
scala> :reset --repl-init-script:'println("Hello")'
Resetting REPL state with the following settings:
--repl-init-script:println("Hello")
Hello
scala>
It’s from “ouside” using the code from command line which is the important use case; so you can pass an import for instance…