From 23c83c0fb6cc75cf7b2cd34c2971fe99e4a56cca Mon Sep 17 00:00:00 2001 From: John Colvin Date: Tue, 29 Aug 2023 00:31:02 -0400 Subject: [PATCH] fix: Skip 1st arg (exe-path) when parsing cmd line This only applies to Spark.exe, where the args are obtained via Environment.GetCommandLineArgs, rather than directly from a 'main' fn. The former prepends the [Spark] exe path to the argv array from 'main', which the CommandLine parser does not expect. --- src/client/spark/App.xaml.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/spark/App.xaml.cs b/src/client/spark/App.xaml.cs index 5854045c3..c074be071 100644 --- a/src/client/spark/App.xaml.cs +++ b/src/client/spark/App.xaml.cs @@ -44,7 +44,7 @@ namespace mbts.ui.shell { #endif public new int Run() { - var argv = SparkCmdOpts.conform_opts(Environment.GetCommandLineArgs()); + var argv = SparkCmdOpts.conform_opts(Environment.GetCommandLineArgs().Skip(1)); int exit_code = 1; Parser.Default.ParseArguments(argv).WithParsed(opts => {