From 75d3c40fcf9633860dcae51a6a9ade6272dcaf71 Mon Sep 17 00:00:00 2001 From: tidusjar Date: Fri, 8 Apr 2016 14:16:06 +0100 Subject: [PATCH] Made the base better --- PlexRequests.UI/Program.cs | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/PlexRequests.UI/Program.cs b/PlexRequests.UI/Program.cs index 0383c3fa2..c726e84aa 100644 --- a/PlexRequests.UI/Program.cs +++ b/PlexRequests.UI/Program.cs @@ -50,18 +50,28 @@ namespace PlexRequests.UI var port = -1; if (args.Length > 0) { - Log.Info("We are going to use port {0} that was passed in", args[0]); - int portResult; - if (!int.TryParse(args[0], out portResult)) + foreach (var a in args) { - Console.WriteLine("Didn't pass in a port"); - Console.WriteLine("Must be the URL Base"); - assetLocation = args[0]; - } - else - { - port = portResult; + if (a.StartsWith("-base", StringComparison.CurrentCultureIgnoreCase)) + { + Console.WriteLine("Settings URL Base"); + assetLocation = args[0]; + } + else + { + Log.Info("We are going to use port {0} that was passed in", a); + int portResult; + if (!int.TryParse(a, out portResult)) + { + Console.WriteLine("Didn't pass in a port"); + } + else + { + port = portResult; + } + } } + } Log.Trace("Getting product version"); WriteOutVersion();