Skip to content

simplify kotlin example in documentation #372

@virtuald

Description

@virtuald

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions