| OVERVIEW | PACKAGE | CONSTR | FIELDS | METHODS | FRAMES NO FRAMES | INHERITED |
class CommandLineParser
extends
ScalaObject
Example usage:
object Options extends CommandLineParser {
val exclude = new StringOption('x', "exclude", "Exclude the given file") with AllowAll
val version = new Flag("version", "Show version info") with AllowNone
override def helpHeader = """
| SomeTool v0.1
| (c) 1908 SomeCorp
|
|""".stripMargin
}
Options.parseOrHelp(argv) { cmd =>
if(cmd(Options.version)) {
...
}
}
def this
|
| helpHeader |
def helpHeader
Override this to define a header for the help message
|
String | |
| permitNonOptions |
def permitNonOptions
Override this to refuse non-option arguments
|
Boolean |
| != |
final def !=(arg0 : Any)
|
Boolean | Any |
| != |
final def !=(arg0 : Object)
|
Boolean | AnyRef |
| == |
final def ==(arg0 : Object)
|
Boolean | AnyRef |
| == |
final def ==(arg0 : Any)
|
Boolean | Any |
| asInstanceOf |
final def asInstanceOf[T0]
|
T0 | Any |
| clone |
protected def clone
|
Object | AnyRef |
| eq |
final def eq(arg0 : Object)
|
Boolean | AnyRef |
| equals |
def equals(arg0 : Any)
|
Boolean | AnyRef |
| finalize |
protected def finalize
|
Unit | AnyRef |
| getClass |
final def getClass
|
Class[Any] | AnyRef |
| hashCode |
def hashCode
|
Int | AnyRef |
| isInstanceOf |
final def isInstanceOf[T0]
|
Boolean | Any |
| ne |
final def ne(arg0 : Object)
|
Boolean | AnyRef |
| notify |
final def notify
|
Unit | AnyRef |
| notifyAll |
final def notifyAll
|
Unit | AnyRef |
| parse |
def parse(argv : Array[String])
Parse the given command line
|
Bistate[Result, String] | |
| parseOrHelp |
def parseOrHelp[A](argv : Array[String])(body : (Result) => A)
Parses the command line and shows a help message if parsing fails
|
Bistate[A, String] | |
| showError |
def showError(msg : String)
Displays a formatted help message and an error message to stderr
|
Unit | |
| showHelp |
def showHelp(out : PrintStream)
Displays a formatted help message
|
Unit | |
| synchronized |
final def synchronized[T0](arg0 : T0)
|
T0 | AnyRef |
| toString |
def toString
|
String | AnyRef |
| wait |
final def wait(arg0 : Long)
|
Unit | AnyRef |
| wait |
final def wait
|
Unit | AnyRef |
| wait |
final def wait(arg0 : Long, arg1 : Int)
|
Unit | AnyRef |
| OVERVIEW | PACKAGE | CONSTR | FIELDS | METHODS | FRAMES NO FRAMES | INHERITED |