Skip to content

Commit e5604b1

Browse files
authored
Add covariance to main method (#197)
Fixes #196
1 parent 3af97bb commit e5604b1

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
### Changed
88
- 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.
99
- `restrictTo` now works with any `Comparable` value, not just `Number`.
10+
- `CliktCommand.main` now accepts `Array<out String>`, not just `Array<String>`.
1011

1112
### Fixed
1213
- Fixed option values being reset when calling multiple subcommands with `allowMultipleSubcommands=true` ([#190](https://github.com/ajalt/clikt/issues/190))

clikt/src/commonMain/kotlin/com/github/ajalt/clikt/core/CliktCommand.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ abstract class CliktCommand(
295295
}
296296
}
297297

298-
fun main(argv: Array<String>) = main(argv.asList())
298+
fun main(argv: Array<out String>) = main(argv.asList())
299299

300300
/**
301301
* Perform actions after parsing is complete and this command is invoked.

0 commit comments

Comments
 (0)