SBT: pass arguments to main

If you write a main class in Scala, sbt will generally find it automatically:

def main(args: Array[String]): Unit = {
  println(args.mkString(", "))
}

If you want to pass arguments to it, you can do that with run-main like so:

sbt "run-main SSLChecker arg1 arg2"

And you’ll get this:

arg1, arg2

Leave a Reply

Your email address will not be published. Required fields are marked *