ajalt / clikt

Multiplatform command line interface parsing for Kotlin
https://ajalt.github.io/clikt/
Apache License 2.0
2.56k stars 123 forks source link

Clikt 5.0.0 does not complain about missing argument when passing unknown option #555

Closed mikaelstaldal closed 2 months ago

mikaelstaldal commented 2 months ago

Given this program:

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
mikaelstaldal commented 1 month ago

Any chance to get a release with this fix soon?