init(14): scala project def with main args

This commit is contained in:
efim
2023-06-30 13:47:20 +00:00
parent b6ba1dfcd0
commit 770b4f6e87
7 changed files with 63 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
package rockpaperscissors
import mainargs.{main, arg, ParserForMethods}
object Main {
@main def run(
@arg(
name = "port",
short = 'p',
doc = "Port on which server will start serving"
)
portArg: Int = 8080,
@arg(name = "host", doc = "Host on which server will start serving.")
hostArg: String = "localhost"
): Unit = {
val a = 1
println(s"Will start server on ${hostArg}:${portArg}")
}
def main(args: Array[String]) = ParserForMethods(this).runOrExit(args)
}

View File

@@ -0,0 +1,8 @@
package example
class ExampleSuite extends munit.FunSuite:
test("addition") {
assert(1 + 1 == 2)
}
end ExampleSuite