docopt language definition can be found on the official webpage.
object Main {
val doc =
"""Usage:
| Main [--force] EXPR
""".stripMargin
def main(_args: Array[String]) {
val args = Docopt(doc, _args)
val experimentFolder = opt.getString("EXPR").get
val force = args.getBoolean("--force", false)
}
}
The library is published to my own maven repo, add the following to your sbt build file:
resolvers += "Chunliang's Maven Repository" at "https://repo.chunlianglyu.com"
libraryDependencies += "com.chunlianglyu.docopt2" %% "docopt2" % "0.2"
Currently 75/81 docopt tests are passed.