-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathProgram.cs
More file actions
38 lines (32 loc) · 1.04 KB
/
Copy pathProgram.cs
File metadata and controls
38 lines (32 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
using Avalonia;
namespace QuestStack;
internal static class Program
{
[STAThread]
public static int Main(string[] args)
{
if (args.Any(argument => string.Equals(argument, "--self-test", StringComparison.OrdinalIgnoreCase)))
return SelfTests.Run(
ReadOption(args, "--abl"),
ReadOption(args, "--ionstack"),
ReadOption(args, "--firmware")) ? 0 : 1;
return BuildAvaloniaApp().StartWithClassicDesktopLifetime(args);
}
public static AppBuilder BuildAvaloniaApp()
{
return AppBuilder.Configure<QuestStackApp>()
.UsePlatformDetect();
}
private static string? ReadOption(string[] args, string optionName)
{
for (int index = 0; index < args.Length; index++)
{
if (!string.Equals(args[index], optionName, StringComparison.OrdinalIgnoreCase))
continue;
if (index + 1 >= args.Length)
return null;
return args[index + 1];
}
return null;
}
}