mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-11-15 18:08:53 -07:00
31 lines
679 B
C#
31 lines
679 B
C#
using System;
|
|
using System.Linq;
|
|
|
|
namespace Emby.Server.Implementations
|
|
{
|
|
public class StartupOptions
|
|
{
|
|
private readonly string[] _options;
|
|
|
|
public StartupOptions(string[] commandLineArgs)
|
|
{
|
|
_options = commandLineArgs;
|
|
}
|
|
|
|
public bool ContainsOption(string option)
|
|
=> _options.Contains(option, StringComparer.OrdinalIgnoreCase);
|
|
|
|
public string GetOption(string name)
|
|
{
|
|
int index = Array.IndexOf(_options, name);
|
|
|
|
if (index == -1)
|
|
{
|
|
return null;
|
|
}
|
|
|
|
return _options.ElementAtOrDefault(index + 1);
|
|
}
|
|
}
|
|
}
|