jellyfin-server/MediaBrowser.Server.Startup.Common/StartupOptions.cs
2014-11-09 13:24:57 -05:00

29 lines
668 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
namespace MediaBrowser.Server.Startup.Common
{
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;
}
}
}