implement optional variable argument/option ranges, refactor exception handling
adapt required/optional argument handling implement bounded/unbounded variable argument handling
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
package com.infendro.cli.parser
|
||||
|
||||
import com.infendro.cli.exception.run.ParseException
|
||||
import com.infendro.cli.exception.run.InvalidValue
|
||||
|
||||
object FloatParser : Parser<Float> {
|
||||
override fun parse(text: String): Float = text.toFloatOrNull()
|
||||
?: throw ParseException(text, "Float")
|
||||
?: throw InvalidValue(text, Float::class)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user