-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathProgram.cs
More file actions
59 lines (50 loc) · 1.93 KB
/
Program.cs
File metadata and controls
59 lines (50 loc) · 1.93 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
using System;
using RayKeys.Misc;
namespace RayKeys {
public static class Program {
[STAThread]
static void Main(string[] args) {
LogLevel logLevel = LogLevel.Info;
foreach (string arg in args) {
if (arg == "--help") {
Console.WriteLine("Usage:\n RayKeys [OPTION]\n\n" +
"RayKeys\n\n" +
"Options:\n" +
" --help Show Help\n" +
" --loglevel=level Change Log Level\n"
);
return;
}
if (arg.StartsWith("--loglevel")) {
switch (arg[(arg.IndexOf('=')+1)..]) {
case "error":
logLevel = LogLevel.Error;
break;
case "info":
logLevel = LogLevel.Info;
break;
case "debug":
logLevel = LogLevel.Debug;
break;
default:
Console.WriteLine("Invalid Log Level, Options are: error, info and debug\n");
return;
}
}
}
try {
using (var game = new Game1(logLevel)) {
game.Run();
}
}
catch (Exception e) {
Logger.Error(e.ToString());
Logger.WaitFlush();
throw;
}
Logger.WaitFlush();
// Stop all threads
Environment.Exit(0);
}
}
}