Skip to content

Commit 3051ae4

Browse files
committed
[增加] 参数解析的错误日志打印
1 parent 21f3771 commit 3051ae4

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

GameFrameX.StartUp/GameApp.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,13 @@ public static async Task Entry(string[] args, Action initAction, Action<LogOptio
5656
LogHelper.Console(string.Empty);
5757
var commandLineParser = new Parser(configuration => { configuration.IgnoreUnknownArguments = true; });
5858

59-
var launcherOptions = commandLineParser.ParseArguments<LauncherOptions>(environmentVariablesList).WithParsed(LauncherOptionsValidate)?.Value;
59+
var launcherOptions = commandLineParser.ParseArguments<LauncherOptions>(environmentVariablesList).WithParsed(LauncherOptionsValidate).WithNotParsed(errors =>
60+
{
61+
foreach (var error in errors)
62+
{
63+
LogHelper.ErrorConsole(error.Tag + ": " + error);
64+
}
65+
})?.Value;
6066
var serverType = launcherOptions?.ServerType;
6167
if (!serverType.IsNullOrEmpty())
6268
{

0 commit comments

Comments
 (0)