mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-30 15:37:55 +02:00
adding support for running integration tests using packaged build.
This commit is contained in:
@@ -1,26 +1,49 @@
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace NzbDrone.Common.EnvironmentInfo
|
||||
{
|
||||
public class StartupArguments
|
||||
public interface IStartupArguments
|
||||
{
|
||||
HashSet<string> Flags { get; }
|
||||
Dictionary<string, string> Args { get; }
|
||||
}
|
||||
|
||||
public const string NO_BROWSER = "no-browser";
|
||||
public class StartupArguments : IStartupArguments
|
||||
{
|
||||
public const string APPDATA = "data";
|
||||
public const string NO_BROWSER = "nobrowser";
|
||||
public const string INSTALL_SERVICE = "i";
|
||||
public const string UNINSTALL_SERVICE = "u";
|
||||
public const string HELP = "?";
|
||||
|
||||
public StartupArguments(string[] args)
|
||||
public StartupArguments(params string[] args)
|
||||
{
|
||||
Flags = new HashSet<string>();
|
||||
Args = new Dictionary<string, string>();
|
||||
|
||||
foreach (var s in args)
|
||||
{
|
||||
var flag = s.Trim(' ', '/', '-').ToLower();
|
||||
Flags.Add(flag);
|
||||
|
||||
var argParts = flag.Split('=');
|
||||
|
||||
if (argParts.Length == 2)
|
||||
{
|
||||
Args.Add(argParts[0].Trim(), argParts[1].Trim(' ', '"'));
|
||||
}
|
||||
else
|
||||
{
|
||||
Flags.Add(flag);
|
||||
}
|
||||
}
|
||||
|
||||
Instance = this;
|
||||
}
|
||||
|
||||
public HashSet<string> Flags { get; private set; }
|
||||
public Dictionary<string, string> Args { get; private set; }
|
||||
|
||||
public static IStartupArguments Instance { get; private set; }
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user