Skip to content

tpunder/scala-optparse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

76 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Scala OptParse

Build Status scala-optparse Scala version support

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).

Supported Scala Versions

  • 2.10
  • 2.11
  • 2.12
  • 2.13
  • 3.x

SBT Dependency

libraryDependencies += "com.frugalmechanic" %% "scala-optparse" % "1.2.0"

Example Usage

import com.frugalmechanic.optparse._

object HelloWorldApp extends OptParse {
  val name = StrOpt()

  def main(args:Array[String]) {
    parse(args)
    println("Hello "+name.getOrElse("world"))
  }
}

Authors

Tim Underwood (GitHub, LinkedIn, Twitter)

Copyright

Copyright Frugal Mechanic

License

Apache License, Version 2.0