mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-05-27 02:56:54 +01:00
Rename and rework entry point
This commit is contained in:
@@ -1,33 +1,30 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Emby.Server.Implementations
|
||||
{
|
||||
public class StartupOptions
|
||||
{
|
||||
private readonly List<string> _options;
|
||||
private readonly string[] _options;
|
||||
|
||||
public StartupOptions(string[] commandLineArgs)
|
||||
{
|
||||
_options = commandLineArgs.ToList();
|
||||
_options = commandLineArgs;
|
||||
}
|
||||
|
||||
public bool ContainsOption(string option)
|
||||
{
|
||||
return _options.Contains(option, StringComparer.OrdinalIgnoreCase);
|
||||
}
|
||||
=> _options.Contains(option, StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
public string GetOption(string name)
|
||||
{
|
||||
var index = _options.IndexOf(name);
|
||||
int index = Array.IndexOf(_options, name);
|
||||
|
||||
if (index != -1)
|
||||
if (index == -1)
|
||||
{
|
||||
return _options.ElementAtOrDefault(index + 1);
|
||||
return null;
|
||||
}
|
||||
|
||||
return null;
|
||||
return _options.ElementAtOrDefault(index + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user