From e5604b1d01e28e9c63d7defed9fdede8f07ca7ed Mon Sep 17 00:00:00 2001 From: AJ Alt Date: Fri, 19 Jun 2020 18:09:50 -0700 Subject: [PATCH] Add covariance to main method (#197) Fixes #196 --- CHANGELOG.md | 1 + .../kotlin/com/github/ajalt/clikt/core/CliktCommand.kt | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 40786b6e8..2bdec37b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ ### Changed - When `printHelpOnEmptyArgs` is `true` and no arguments are present, or when `invokeWithoutSubcommand` is `false` and no subcommand is present, `CliktCommand.main` will now exit with status code 1 rather than 0. - `restrictTo` now works with any `Comparable` value, not just `Number`. +- `CliktCommand.main` now accepts `Array`, not just `Array`. ### Fixed - Fixed option values being reset when calling multiple subcommands with `allowMultipleSubcommands=true` ([#190](https://github.com/ajalt/clikt/issues/190)) diff --git a/clikt/src/commonMain/kotlin/com/github/ajalt/clikt/core/CliktCommand.kt b/clikt/src/commonMain/kotlin/com/github/ajalt/clikt/core/CliktCommand.kt index c5eb4f5b2..fded140e2 100644 --- a/clikt/src/commonMain/kotlin/com/github/ajalt/clikt/core/CliktCommand.kt +++ b/clikt/src/commonMain/kotlin/com/github/ajalt/clikt/core/CliktCommand.kt @@ -295,7 +295,7 @@ abstract class CliktCommand( } } - fun main(argv: Array) = main(argv.asList()) + fun main(argv: Array) = main(argv.asList()) /** * Perform actions after parsing is complete and this command is invoked.