aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Server/Program.cs
diff options
context:
space:
mode:
authorPloughPuff <ploughpuff@protonmail.com>2019-01-28 20:58:47 +0000
committerBond-009 <bond.009@outlook.com>2019-01-31 18:56:34 +0100
commite18b89ca275feceee21b540878017a2373e7de6c (patch)
treed81c2b3c19a418d609c0ba66c71b85eb3f83106e /Jellyfin.Server/Program.cs
parentebd2a3008791ac4043a775d48f0971a554bd9ff4 (diff)
Move Options to Jellyfin.Server and create interface file
Changes following review comments.
Diffstat (limited to 'Jellyfin.Server/Program.cs')
-rw-r--r--Jellyfin.Server/Program.cs21
1 files changed, 10 insertions, 11 deletions
diff --git a/Jellyfin.Server/Program.cs b/Jellyfin.Server/Program.cs
index 2f7edee65..905cf3aa0 100644
--- a/Jellyfin.Server/Program.cs
+++ b/Jellyfin.Server/Program.cs
@@ -6,8 +6,10 @@ using System.Net;
using System.Net.Security;
using System.Reflection;
using System.Runtime.InteropServices;
+using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;
+using CommandLine;
using Emby.Drawing;
using Emby.Server.Implementations;
using Emby.Server.Implementations.EnvironmentInfo;
@@ -26,9 +28,6 @@ using ILogger = Microsoft.Extensions.Logging.ILogger;
namespace Jellyfin.Server
{
- using CommandLine;
- using System.Text.RegularExpressions;
-
public static class Program
{
private static readonly CancellationTokenSource _tokenSource = new CancellationTokenSource();
@@ -41,8 +40,8 @@ namespace Jellyfin.Server
// For backwards compatibility.
// Modify any input arguments now which start with single-hyphen to POSIX standard
// double-hyphen to allow parsing by CommandLineParser package.
- var pattern = @"^(-[^-\s]{2})"; // Match -xx, not -x, not --xx, not xx
- var substitution = @"-$1"; // Prepend with additional single-hyphen
+ const string pattern = @"^(-[^-\s]{2})"; // Match -xx, not -x, not --xx, not xx
+ const string substitution = @"-$1"; // Prepend with additional single-hyphen
var regex = new Regex(pattern);
for (var i = 0; i < args.Length; i++)
@@ -152,9 +151,9 @@ namespace Jellyfin.Server
string programDataPath = Environment.GetEnvironmentVariable("JELLYFIN_DATA_PATH");
if (string.IsNullOrEmpty(programDataPath))
{
- if (options.PathData != null)
+ if (options.DataDir != null)
{
- programDataPath = options.PathData;
+ programDataPath = options.DataDir;
}
else
{
@@ -190,9 +189,9 @@ namespace Jellyfin.Server
string configDir = Environment.GetEnvironmentVariable("JELLYFIN_CONFIG_DIR");
if (string.IsNullOrEmpty(configDir))
{
- if (options.PathConfig != null)
+ if (options.ConfigDir != null)
{
- configDir = options.PathConfig;
+ configDir = options.ConfigDir;
}
else
{
@@ -209,9 +208,9 @@ namespace Jellyfin.Server
string logDir = Environment.GetEnvironmentVariable("JELLYFIN_LOG_DIR");
if (string.IsNullOrEmpty(logDir))
{
- if (options.PathLog != null)
+ if (options.LogDir != null)
{
- logDir = options.PathLog;
+ logDir = options.LogDir;
}
else
{