implement automatic help

This commit is contained in:
2026-01-07 18:53:35 +01:00
parent 4e9b358ef8
commit ecd255479a
18 changed files with 277 additions and 88 deletions

View File

@@ -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)
}