implement automatic help
This commit is contained in:
@@ -1,5 +1,12 @@
|
||||
package com.infendro.cli.parser
|
||||
|
||||
interface Parser<T> {
|
||||
import com.infendro.cli.exception.run.InvalidValue
|
||||
import kotlin.reflect.KClass
|
||||
|
||||
interface Parser<T : Any> {
|
||||
val type: KClass<T>
|
||||
|
||||
fun parse(text: String): T
|
||||
|
||||
fun invalid(text: String): Nothing = throw InvalidValue(text, type)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user