diff options
| author | crobibero <cody@robibe.ro> | 2020-07-21 08:03:09 -0600 |
|---|---|---|
| committer | crobibero <cody@robibe.ro> | 2020-07-21 08:03:09 -0600 |
| commit | b040d89e5cda3d49ecb45e5441053dc61872f272 (patch) | |
| tree | 81455a2f97d10c06c20a491a5c46e75fbac1fb47 /Jellyfin.Server/Program.cs | |
| parent | 0740ec611211cb121a2ea4f97ab43b92d6411d4d (diff) | |
| parent | 5b57c81ee14ce585161b9ac331e6e3528826b815 (diff) | |
Merge remote-tracking branch 'upstream/api-migration' into api-image-service
Diffstat (limited to 'Jellyfin.Server/Program.cs')
| -rw-r--r-- | Jellyfin.Server/Program.cs | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/Jellyfin.Server/Program.cs b/Jellyfin.Server/Program.cs index dfc7bbbb1..288a5c259 100644 --- a/Jellyfin.Server/Program.cs +++ b/Jellyfin.Server/Program.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; @@ -6,7 +7,6 @@ using System.Net; using System.Reflection; using System.Runtime.InteropServices; using System.Text; -using System.Text.RegularExpressions; using System.Threading; using System.Threading.Tasks; using CommandLine; @@ -59,20 +59,15 @@ namespace Jellyfin.Server /// <returns><see cref="Task" />.</returns> public static Task Main(string[] args) { - // For backwards compatibility. - // Modify any input arguments now which start with single-hyphen to POSIX standard - // double-hyphen to allow parsing by CommandLineParser package. - const string Pattern = @"^(-[^-\s]{2})"; // Match -xx, not -x, not --xx, not xx - const string Substitution = @"-$1"; // Prepend with additional single-hyphen - var regex = new Regex(Pattern); - for (var i = 0; i < args.Length; i++) + static Task ErrorParsingArguments(IEnumerable<Error> errors) { - args[i] = regex.Replace(args[i], Substitution); + Environment.ExitCode = 1; + return Task.CompletedTask; } // Parse the command line arguments and either start the app or exit indicating error return Parser.Default.ParseArguments<StartupOptions>(args) - .MapResult(StartApp, _ => Task.CompletedTask); + .MapResult(StartApp, ErrorParsingArguments); } /// <summary> @@ -279,10 +274,10 @@ namespace Jellyfin.Server var addresses = appHost.ServerConfigurationManager .Configuration .LocalNetworkAddresses - .Select(appHost.NormalizeConfiguredLocalAddress) + .Select(x => appHost.NormalizeConfiguredLocalAddress(x)) .Where(i => i != null) .ToHashSet(); - if (addresses.Any() && !addresses.Contains(IPAddress.Any)) + if (addresses.Count > 0 && !addresses.Contains(IPAddress.Any)) { if (!addresses.Contains(IPAddress.Loopback)) { |
