We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Object
I use clikt in kts files and it is perfect. Could you please clarify one issue.
kts
This code works as intended:
class Options1 : NoOpCliktCommand() { val input by option(help = "Input contents") init { main(args) } } println(Options1().input)
So does this one (the one I use):
object Options2 : NoOpCliktCommand() { val input by option(help = "Input contents") } Options2.main(args) println(Options2.input)
But this one fails (would be cleanest in simple cases, IMHO):
object Options3 : NoOpCliktCommand() { val input by option(help = "Input contents") init { this.main(args) } } println(Options3.input)
The message is error: object Options3 captures the script class instance
error: object Options3 captures the script class instance
The text was updated successfully, but these errors were encountered:
That error isn't from Clikt, it's from Kotlin itself, so there's nothing I can do about it on my end.
The first result from googling that error message was this Kotlin issue: https://youtrack.jetbrains.com/issue/KT-32410
Seems like it will be fixed in Kotlin 2.0.
Sorry, something went wrong.
No branches or pull requests
I use clikt in
kts
files and it is perfect. Could you please clarify one issue.This code works as intended:
So does this one (the one I use):
But this one fails (would be cleanest in simple cases, IMHO):
The message is
error: object Options3 captures the script class instance
The text was updated successfully, but these errors were encountered: