jellyfin-server/Emby.Server.Core/StartupOptions.cs
2016-11-11 00:23:15 -05:00

29 lines
650 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
namespace Emby.Server.Core
{
public class StartupOptions
{
private readonly List<string> _options = Environment.GetCommandLineArgs().ToList();
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;
}
}
}