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)
.let { namesFromAnnotation ->
if (namesFromAnnotation.isNotEmpty()) {
namesFromAnnotation
} else arrayOf(function.name)
namesFromAnnotation.map(String::toLowerCase).toTypedArray()
} else arrayOf(function.name.toLowerCase())
}.also { names ->
names.forEach {
check(it.isValidSubName()) {