interfaceorg.draftcode.argot
Converter<T>
Converts a raw command-line string into a typed value. Implement this to support a type beyond the built-ins.
object SlugConverter : Converter<String> {
override val typeName: String = "slug"
override fun convert(raw: String): String {
require(raw.all { it.isLetterOrDigit() || it == '-' }) { "not a slug: '$raw'" }
return raw.lowercase()
}
}Properties
typeName
open val typeName: String
A short name for the target type (for example "Int"), shown in help and error messages.