I am starting to use sbt build my Scala code (and handle dependencies). As far as I know if I use
$ sbt run
on the command line th
This works: sbt "runMain com.example.Hello arg1"
or sbt "run-main com.example.Hello arg1"
.
See here for reference: https://blog.ssanj.net/posts/2016-03-02-how-to-run-a-specific-main-class-with-parameters-through-sbt.html
$ sbt foo/run arg1 arg2
also work
You simply have to quote each command (as in the second example on this page), so in your case it would be:
$ sbt "project foo" "run arg1 arg2"
Worked for me:
$ sbt "run someNumber"
Also this may be of some help:
def main(args: Array[String]) {
val n = args(0).toInt
}