chksum/Program.cs
FUH22860 454717431f
Commandline args && New features
chksum can now take arguments to execute diffrent functions
functions include checksumming, counting all checksums, deleting all checksums
2023-05-17 12:18:20 +02:00

50 lines
1.7 KiB
C#

public class Program {
static void Main(string[] args) {
if (args.Length == 0) {
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("Please specify an option.");
Console.ResetColor();
Console.WriteLine("Options are: checksum, countmd5, deletemd5");
} else {
switch(args[0]) {
case "checksum":
Console.ForegroundColor = ConsoleColor.Green;
Console.WriteLine("Starting the checksum process.");
Console.ResetColor();
Chksum.doTheThing();
Console.ForegroundColor = ConsoleColor.Green;
Console.WriteLine("Checksum process finished");
Console.ResetColor();
break;
case "countmd5":
Console.ForegroundColor = ConsoleColor.Green;
Console.WriteLine("Counting md5 checksum files.");
Console.ResetColor();
Chksum.countAllMd5Checksums();
Console.ForegroundColor = ConsoleColor.Green;
Console.WriteLine("Finished counting all md5 checksum files.");
Console.ResetColor();
break;
case "deletemd5":
Console.ForegroundColor = ConsoleColor.Green;
Console.WriteLine("Deleting all md5 checksum files.");
Console.ResetColor();
Chksum.deleteAllMd5Checksums();
Console.ForegroundColor = ConsoleColor.Green;
Console.WriteLine("Deleted all md5 checksum files.");
Console.ResetColor();
break;
default:
break;
}
}
}
}