This repository has been archived by the owner on Sep 24, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.cs
58 lines (53 loc) · 1.86 KB
/
Program.cs
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
using System;
namespace TwoFour
{
public class Program
{
public static void Main(string[] args)
{
// If we don't have the right number of inputs, show help and exit
if (args.Length < 2)
{
Console.WriteLine("At least 2 arguments are required");
DisplayHelp();
return;
}
// Get rebuild depth from first arg
int depth;
if (args[0] == "rvx" || args[0] == "romvaultx" || args[0] == "romroot")
depth = 2;
else if (args[0] == "romba" || args[0] == "depot")
depth = 4;
else if (!int.TryParse(args[0], out depth))
depth = -1;
// If neither matched, show help and exit
if (depth < 0)
{
Console.WriteLine($"{args[0]} is not a valid depth");
DisplayHelp();
return;
}
// Process each directory from remaining args
for (int i = 1; i < args.Length; i++)
{
Processor processor = new Processor(args[i], depth);
if (!processor.ProcessFolder())
{
DisplayHelp();
return;
}
}
}
/// <summary>
/// Display the help text
/// </summary>
private static void DisplayHelp()
{
Console.WriteLine("Usage: TwoFour.exe [mode] [path\\to\\folder] ...");
Console.WriteLine();
Console.WriteLine("Special modes for 2-deep: rvx, romvaultx, romroot");
Console.WriteLine("Special modes for 4-deep: romba, depot");
Console.WriteLine("All other positive numbers are allowed");
}
}
}