package com.example
import com.github.ajalt.clikt.core.CliktCommand
import com.github.ajalt.clikt.core.main
import com.github.ajalt.clikt.parameters.arguments.argument
class Hello : CliktCommand() {
val name by argument()
override fun run() {
echo("Hello $name!")
}
}
fun main(args: Array<String>) = Hello().main(arrayOf("--foo"))
Clikt before 5.0.0 would output:
Usage: hello [<options>] <name>
Error: no such option --foo
Error: missing argument <name>
But Clikt 5.0.0 only outputs this:
Usage: hello [<options>] <name>
Error: no such option --foo
Given this program:
Clikt before 5.0.0 would output:
But Clikt 5.0.0 only outputs this: