Instead of
@Command
class MyApp {
...
companion object {
@JvmStatic fun main(args: Array<String>) {
CommandLine.run(MyApp(), System.err, *args)
}
}
}
It's easier to do this instead:
@Command
class MyApp {
...
}
fun main(args: Array<String>) = CommandLine.run(MyApp(), System.err, *args)
Idea borrowed from clikt's documentation.