From a2274222c26113a963411633306d8fb6e4f2651e Mon Sep 17 00:00:00 2001 From: rfi Date: Mon, 27 Nov 2023 20:00:58 +0700 Subject: [PATCH] slightly improve help --- AscNet.GameServer/Commands/Command.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/AscNet.GameServer/Commands/Command.cs b/AscNet.GameServer/Commands/Command.cs index b62418d..7dfdaa5 100644 --- a/AscNet.GameServer/Commands/Command.cs +++ b/AscNet.GameServer/Commands/Command.cs @@ -91,12 +91,13 @@ namespace AscNet.GameServer.Commands { List argsProperties = cmd.GetType().GetProperties(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance).Where(x => x.GetCustomAttribute(typeof(ArgumentAttribute)) is not null).ToList(); - helpText += $"{command} {string.Join(" ", argsProperties.Select(x => $"<{x.Name}>"))}\n└─{cmd.Help}\n"; + helpText += $"{command} {string.Join(" ", argsProperties.Select(x => $"<{x.Name}>"))}\n{cmd.Help}\n"; foreach (var argProp in argsProperties) { ArgumentAttribute attr = (ArgumentAttribute)argProp.GetCustomAttribute(typeof(ArgumentAttribute))!; - helpText += string.Format($"└─{argProp.Name} \"{attr.Pattern}\"{{0}}\n", string.IsNullOrEmpty(attr.Description) ? string.Empty : $", {attr.Description}"); + helpText += string.Format($"└{argProp.Name} \"{attr.Pattern}\"{{0}}\n", string.IsNullOrEmpty(attr.Description) ? string.Empty : $", {attr.Description}"); } + helpText += '\n'; } }