fix: trim /xlhelp arguments

This commit is contained in:
Aireil 2023-02-20 04:01:05 +01:00
parent 85798cc11a
commit 43d9cf36fa
No known key found for this signature in database
GPG key ID: EA9CA38B48706D3D

View file

@ -160,7 +160,8 @@ internal class DalamudCommands : IServiceType
}
else
{
var targetCommandText = arguments[0] == '/' ? arguments : $"/{arguments}";
var trimmedArguments = arguments.Trim();
var targetCommandText = trimmedArguments[0] == '/' ? trimmedArguments : $"/{trimmedArguments}";
chatGui.Print(commandManager.Commands.TryGetValue(targetCommandText, out var targetCommand)
? $"{targetCommandText}: {targetCommand.HelpMessage}"
: Loc.Localize("DalamudCmdHelpNotFound", "Command not found."));