Fix SubCommand name, use lowercase

This commit is contained in:
Him188 2020-09-01 20:45:50 +08:00
parent 0b72ee424c
commit bd91d93fc9

View File

@ -297,8 +297,8 @@ internal fun AbstractReflectionCommand.createSubCommand(
subCommandAnnotationResolver.getSubCommandNames(this, function) subCommandAnnotationResolver.getSubCommandNames(this, function)
.let { namesFromAnnotation -> .let { namesFromAnnotation ->
if (namesFromAnnotation.isNotEmpty()) { if (namesFromAnnotation.isNotEmpty()) {
namesFromAnnotation namesFromAnnotation.map(String::toLowerCase).toTypedArray()
} else arrayOf(function.name) } else arrayOf(function.name.toLowerCase())
}.also { names -> }.also { names ->
names.forEach { names.forEach {
check(it.isValidSubName()) { check(it.isValidSubName()) {