Scala OptParse is a simple command line parsing library for Scala.
This was one of the first Scala libraries that I wrote (as you can probably tell by looking at the code). It is still in production use today (as of Jan 2022) although no longer at Frugal Mechanic (which no longer exists).
- 2.10
- 2.11
- 2.12
- 2.13
- 3.x
libraryDependencies += "com.frugalmechanic" %% "scala-optparse" % "1.2.0"
import com.frugalmechanic.optparse._
object HelloWorldApp extends OptParse {
val name = StrOpt()
def main(args:Array[String]) {
parse(args)
println("Hello "+name.getOrElse("world"))
}
}
Tim Underwood (GitHub, LinkedIn, Twitter)
Copyright Frugal Mechanic