From 8b6e2a1d9cd4737a58e2e53a962c113c217c1dc9 Mon Sep 17 00:00:00 2001 From: Karlatemp Date: Mon, 9 Nov 2020 13:16:44 +0800 Subject: [PATCH] Update AbstractCommandValueParameter.render style --- backend/mirai-console/src/internal/command/CommandReflector.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/mirai-console/src/internal/command/CommandReflector.kt b/backend/mirai-console/src/internal/command/CommandReflector.kt index 1bf73d773..867c50ec3 100644 --- a/backend/mirai-console/src/internal/command/CommandReflector.kt +++ b/backend/mirai-console/src/internal/command/CommandReflector.kt @@ -174,7 +174,8 @@ internal class CommandReflector( is AbstractCommandValueParameter.Extended, is AbstractCommandValueParameter.UserDefinedType<*>, -> { - "<${this.name ?: this.type.classifierAsKClass().simpleName}>" + val nameToRender = this.name ?: this.type.classifierAsKClass().simpleName + if (isOptional) "[$nameToRender]" else "<$nameToRender>" } is AbstractCommandValueParameter.StringConstant -> { this.expectingValue