upload
This commit is contained in:
commit
1c7a8cf25f
579 files changed
+83196
No files matched your search
@@ -0,0 +1,44 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
|
||||
namespace VibranceHud;
|
||||
|
||||
public static class LaunchOptions
|
||||
{
|
||||
public const string TraySwitch = "--tray";
|
||||
|
||||
public const string TraceColourSwitch = "--trace-colour";
|
||||
|
||||
public static bool StartInTray { get; private set; }
|
||||
|
||||
public static bool TraceColour { get; private set; }
|
||||
|
||||
public static void Parse(string[]? args)
|
||||
{
|
||||
StartInTray = Has(args, "--tray");
|
||||
TraceColour = Has(args, "--trace-colour");
|
||||
}
|
||||
|
||||
public static string[] WithTraySwitch(string[]? args)
|
||||
{
|
||||
if (args != null && Has(args, "--tray"))
|
||||
{
|
||||
return args;
|
||||
}
|
||||
string[] array = new string[(args?.Length ?? 0) + 1];
|
||||
args?.CopyTo(array, 0);
|
||||
array[^1] = "--tray";
|
||||
return array;
|
||||
}
|
||||
|
||||
private static bool Has(string[]? args, string option)
|
||||
{
|
||||
return args?.Any((string a) => string.Equals(a, option, StringComparison.OrdinalIgnoreCase)) ?? false;
|
||||
}
|
||||
|
||||
internal static void ResetForTest()
|
||||
{
|
||||
StartInTray = false;
|
||||
TraceColour = false;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user