MCPcopy Create free account
hub / github.com/StereoKit/StereoKit / Main

Method Main

tools/StereoKitAPIGen/Program.cs:13–107  ·  view source on GitHub ↗
(string[] args)

Source from the content-addressed store, hash-verified

11 }
12
13 static void Main(string[] args)
14 {
15 // This application needs parameters to work!
16 if (args.Length == 0)
17 {
18 //-f "$(SolutionDir)\StereoKitC\stereokit.h" -o SKOverrides.txt -d "$(SolutionDir)\StereoKit\Native"
19 args = new string[] {
20 "-f", "../../../../../StereoKitC/stereokit.h",
21 "-o", "SKOverrides.txt",
22 "-d", "../../../../../StereoKit/Native"};
23 }
24
25 // Parse the parameters into stuff we can work with
26 List<string> files = new List<string>();
27 BindLang lang = BindLang.None;
28 string destFolder = "";
29 int curr = 0;
30 while (curr < args.Length)
31 {
32 if (args[curr].ToLower() == "-o")
33 {
34 if (curr + 1 < args.Length) {
35 if (!NameOverrides.Load(args[curr + 1])) return;
36 curr += 2;
37 } else {
38 Console.WriteLine("ERROR: Missing parameter for -o, need a file path for name overrides!");
39 DisplayHelp();
40 return;
41 }
42 }
43 else if (args[curr].ToLower() == "-f")
44 {
45 if (curr + 1 < args.Length) {
46 files.Add(args[curr + 1]);
47 curr += 2;
48 } else {
49 Console.WriteLine("ERROR: Missing parameter for -f, need a file path to a C++ header!");
50 DisplayHelp();
51 return;
52 }
53 }
54 else if (args[curr].ToLower() == "-l")
55 {
56 if (curr + 1 < args.Length) {
57 if (Enum.TryParse(args[curr + 1], true, out BindLang langArg)) lang = langArg;
58 else { Console.WriteLine($"Invalid language identifier '{args[curr + 1]}'!"); return; }
59
60 curr += 2;
61 } else {
62 Console.WriteLine("ERROR: Missing parameter for -l, need a language identifier!");
63 DisplayHelp();
64 return;
65 }
66 }
67 else if (args[curr].ToLower() == "-d")
68 {
69 if (curr + 1 < args.Length) {
70 destFolder = args[curr + 1];

Callers

nothing calls this directly

Calls 3

BindMethod · 0.80
LoadMethod · 0.45
AddMethod · 0.45

Tested by

no test coverage detected