mainReturningValue

inline fun <T : BaseCliktCommand<T>, R> mainReturningValue(command: T, parseAndRun: T.() -> R): R

Call parseAndRun on the given command. If an error is thrown, exit the process with the error's status code.

Return

The value returned by parseAndRun

Throws

If run on Kotlin/JS on browsers and an error occurs, since it's not possible to exit the process in that case.