Rename and rework entry point

This commit is contained in:
Bond_009
2019-01-01 16:27:11 +01:00
committed by Vasily
parent e094c45abb
commit 75efe9cf0a
25 changed files with 461 additions and 756 deletions

View File

@@ -1,33 +1,30 @@
using System;
using System.Collections.Generic;
using System.Linq;
namespace Emby.Server.Implementations
{
public class StartupOptions
{
private readonly List<string> _options;
private readonly string[] _options;
public StartupOptions(string[] commandLineArgs)
{
_options = commandLineArgs.ToList();
_options = commandLineArgs;
}
public bool ContainsOption(string option)
{
return _options.Contains(option, StringComparer.OrdinalIgnoreCase);
}
=> _options.Contains(option, StringComparer.OrdinalIgnoreCase);
public string GetOption(string name)
{
var index = _options.IndexOf(name);
int index = Array.IndexOf(_options, name);
if (index != -1)
if (index == -1)
{
return _options.ElementAtOrDefault(index + 1);
return null;
}
return null;
return _options.ElementAtOrDefault(index + 1);
}
}
}