diff --git a/Split-FANUC-Program-Backup/Program.cs b/Split-FANUC-Program-Backup/Program.cs index 645a3b3..ab94c06 100644 --- a/Split-FANUC-Program-Backup/Program.cs +++ b/Split-FANUC-Program-Backup/Program.cs @@ -8,7 +8,7 @@ namespace SplitFANUCProgramBackup { - static class Program + public static class Program { private static string ThisExecutableName => AppDomain.CurrentDomain.FriendlyName; private static Version? AssemblyVersion => Assembly.GetExecutingAssembly().GetName().Version; @@ -48,7 +48,12 @@ private static string BuildDate /// private const string directoryFlag = @"(&F=)"; - static async Task Main(string[] args) + /// + /// Command line entry point + /// + /// Requires only one argument: full path to the backup file. + /// Zero for success + public static async Task Main(string[] args) { DisplayHeader(); @@ -132,7 +137,7 @@ private static string GetProgramNameFromHeader(string cncProgramText) /// /// Full path to "ALL-PROG.TXT" /// Each CNC program as a string, and any associated subdirectory - static IEnumerable<(string SubFolder, string ProgramText)> GetCNCProgams(string fileName, string outputFolder) + private static IEnumerable<(string SubFolder, string ProgramText)> GetCNCProgams(string fileName, string outputFolder) { StringBuilder content = new(); string subFolder = ""; @@ -176,7 +181,7 @@ private static string GetProgramNameFromHeader(string cncProgramText) yield return (subFolder, CncProgramText(content)); } - static string CncProgramText(StringBuilder content) + private static string CncProgramText(StringBuilder content) { // Prevent IndexOutOfBounds exceptions if final program is empty if (content.Length > minimumProgramSize) @@ -203,7 +208,7 @@ private static void NotFoundError(string fileName) Console.WriteLine("File not found: " + fileName); } - static void DisplayHelp() + private static void DisplayHelp() { Console.WriteLine(@" At least one argument required. Enter only the path of the file you would like to split.