jellyfin/Emby.Server.Core/StartupOptions.cs

29 lines
650 B
C#
Raw Normal View History

2014-09-14 08:26:33 -07:00
using System;
using System.Collections.Generic;
using System.Linq;
2016-11-10 22:23:15 -07:00
namespace Emby.Server.Core
2014-09-14 08:26:33 -07:00
{
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;
}
}
}