CommandLineParser
A utility object to support command line parsing for @main methods.
Attributes
- Source
- CommandLineParser.scala
- Graph
-
- Supertypes
- Self type
-
CommandLineParser.type
Members list
Type members
Classlikes
Attributes
- Companion
- trait
- Source
- CommandLineParser.scala
- Supertypes
- Self type
-
FromString.type
Attributes
- Companion
- object
- Source
- CommandLineParser.scala
- Supertypes
- Known subtypes
-
object given_FromString_Booleanobject given_FromString_Byteobject given_FromString_Doubleobject given_FromString_Floatobject given_FromString_Intobject given_FromString_Longobject given_FromString_Shortobject given_FromString_StringShow all
An exception raised for an illegal command line.
An exception raised for an illegal command line.
Value parameters
- idx
-
The index of the argument that's faulty (starting from 0)
- msg
-
The error message
Attributes
- Source
- CommandLineParser.scala
- Supertypes
Value members
Concrete methods
Parses n'th argument in args (counting from 0) as a value of type T.
Parses n'th argument in args (counting from 0) as a value of type T.
Type parameters
- T
-
the target type to parse the argument into
Value parameters
- args
-
the command line arguments array
- fs
-
the type class instance that converts a string to type
T - n
-
the zero-based index of the argument to parse
Attributes
- Throws
-
ParseError
if argument does not exist or cannot be converted to type
T. - Source
- CommandLineParser.scala
Parses all arguments from n'th one (counting from 0) as a list of values of type T.
Parses all arguments from n'th one (counting from 0) as a list of values of type T.
Type parameters
- T
-
the target type to parse each argument into
Value parameters
- args
-
the command line arguments array
- fs
-
the type class instance that converts a string to type
T - n
-
the zero-based index of the first remaining argument to parse
Attributes
- Throws
-
ParseError
if some of the arguments cannot be converted to type
T. - Source
- CommandLineParser.scala
Parses command line argument s, which has index n, as a value of type T.
Parses command line argument s, which has index n, as a value of type T.
Type parameters
- T
-
the target type to parse the string into
Value parameters
- fs
-
the type class instance (usually provided implicitly) that converts a string to type
T - n
-
the zero-based index of the argument, used for error reporting
- str
-
the command line argument string to parse
Attributes
- Throws
-
ParseError
if argument cannot be converted to type
T. - Source
- CommandLineParser.scala
Prints error message explaining given ParserError.
Prints error message explaining given ParserError.
Value parameters
- err
-
the parse error to display
Attributes
- Source
- CommandLineParser.scala