Skip to content

Commit

Permalink
Add explicit access modifiers
Browse files Browse the repository at this point in the history
 -  Comment on Main
  • Loading branch information
A9G-Data-Droid committed Apr 26, 2022
1 parent 41a2eda commit f68cd33
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions Split-FANUC-Program-Backup/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -48,7 +48,12 @@ private static string BuildDate
/// </summary>
private const string directoryFlag = @"(&F=)";

static async Task<int> Main(string[] args)
/// <summary>
/// Command line entry point
/// </summary>
/// <param name="args">Requires only one argument: full path to the backup file.</param>
/// <returns>Zero for success</returns>
public static async Task<int> Main(string[] args)
{
DisplayHeader();

Expand Down Expand Up @@ -132,7 +137,7 @@ private static string GetProgramNameFromHeader(string cncProgramText)
/// </summary>
/// <param name="fileName">Full path to "ALL-PROG.TXT"</param>
/// <returns>Each CNC program as a string, and any associated subdirectory</returns>
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 = "";
Expand Down Expand Up @@ -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)
Expand All @@ -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.
Expand Down

0 comments on commit f68cd33

Please sign in to comment.