init(15): sbt project with mainargs

This commit is contained in:
efim
2023-07-08 17:06:32 +00:00
parent 084035fdcb
commit c27cb67c2a
7 changed files with 59 additions and 0 deletions

View File

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