From be8bc54e460d37f14eae1f03444c63e1856fda96 Mon Sep 17 00:00:00 2001 From: John Colvin Date: Tue, 25 Jan 2022 14:14:45 -0500 Subject: [PATCH] fix: Remove configserver arg when parsing CLIOptions --- src/client/spark/App.xaml.cs | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/client/spark/App.xaml.cs b/src/client/spark/App.xaml.cs index b788315a5..386cc7c6e 100644 --- a/src/client/spark/App.xaml.cs +++ b/src/client/spark/App.xaml.cs @@ -1,4 +1,4 @@ -namespace mbts.ui.shell { +namespace mbts.ui.shell { using bts; using bts.utils; @@ -7,6 +7,7 @@ using mbts.ui.native; using System; + using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.Globalization; @@ -42,7 +43,20 @@ #endif public new int Run() { - var argv = Environment.GetCommandLineArgs(); + var argv = Environment.GetCommandLineArgs().ToList(); + + // TODO: Add configserver arg to CLIOptions (for now, just strip it + // out before parsing) + for (int i = 0; i < argv.Count; i++) { + if (argv[i].ToLower() == "-configserver") { + argv.RemoveAt(i); + if (i < argv.Count) { + argv.RemoveAt(i); + } + break; + } + } + int exit_code = 1; Parser.Default.ParseArguments(argv).WithParsed(opts => { _opts = opts;