trait ParsersApi extends AnyRef
- Alphabetic
- By Inheritance
- ParsersApi
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- class ArgumentParser extends AnyRef
A simple command line argument parser.
A simple command line argument parser.
Usage:
1. Define parameters with param, requiredParam and repeatedParam. Each of these methods gives back a handle to a future argument value.
2. Call
parseOrExit()
with actual arguments.3. If parsing succeeds, the arguments will be available in the handles defined in step 1.
If parsing fails, error descriptions are printed and the program exits with 2.
Example:
scala val parser = argparse.default.ArgumentParser()
val p1 = parser.param[String]("--this-is-a-named-param", default = "default value") val p2 = parser.param[Int]("positional-param", default = 2)
parser.parseOrExit(Seq("--this-is-a-named-param=other", 5)) println(p1.value) println(p2.value)
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def defaultBashCompletionFlags: Seq[String]
The name of the flag to use for generating standalone bash-completion.
The name of the flag to use for generating standalone bash-completion.
Set this to empty to disable bash-completion entirely.
Note that individual argument parsers may override this.
- def defaultHelpFlags: Seq[String]
The name of the flag to use for printing help messages.
The name of the flag to use for printing help messages.
Set this to empty to disable help entirely.
Note that individual argument parsers may override this.
- def defaultHelpMessage(parser: ArgumentParser): String
Generate a help message from parameters.
Generate a help message from parameters.
This message will be used by
ArgumentParser
s. Overriding this allows you to customize the help message of allArgumentParser
s. - final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def exit(code: Int): Nothing
Called by parseOrExit in case of error.
Called by parseOrExit in case of error.
Overriding this can be useful in situations where you do not want to exit, for example in tests.
- Attributes
- protected
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- object ArgumentParser