2014-09-14 15:26:33 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
2016-11-18 21:06:00 +00:00
|
|
|
|
namespace Emby.Server.Implementations
|
2014-09-14 15:26:33 +00:00
|
|
|
|
{
|
|
|
|
|
public class StartupOptions
|
|
|
|
|
{
|
2016-11-18 21:06:00 +00:00
|
|
|
|
private readonly List<string> _options;
|
|
|
|
|
|
|
|
|
|
public StartupOptions(string[] commandLineArgs)
|
|
|
|
|
{
|
|
|
|
|
_options = commandLineArgs.ToList();
|
|
|
|
|
}
|
2014-09-14 15:26:33 +00:00
|
|
|
|
|
|
|
|
|
public bool ContainsOption(string option)
|
|
|
|
|
{
|
|
|
|
|
return _options.Contains(option, StringComparer.OrdinalIgnoreCase);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public string GetOption(string name)
|
|
|
|
|
{
|
|
|
|
|
var index = _options.IndexOf(name);
|
|
|
|
|
|
|
|
|
|
if (index != -1)
|
|
|
|
|
{
|
|
|
|
|
return _options.ElementAtOrDefault(index + 1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|