Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Context parameter is null in exception constructor calls, so default localization is used instead of an explicitly defined one #399

Closed
sirjoga opened this issue Mar 27, 2023 · 0 comments · Fixed by #401

Comments

@sirjoga
Copy link

sirjoga commented Mar 27, 2023

version: 3.5.2

Example code:

fun main() {
    object: NoOpCliktCommand() {
        init {
            context {
                localization = object : Localization {
                    override fun noSuchOption(name: String, possibilities: List<String>) = "it's useless"
                }
            }
        }

    }.main(arrayOf("-s"))
}

expected output: Error: it's useless
actual output: Error: no such option: "-s"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant