Fix edge-case issues with Help functionality; modernize features

This commit is contained in:
Matt Nadareski
2025-04-18 11:54:59 -04:00
parent a59de70a4f
commit 9f42399165
21 changed files with 742 additions and 653 deletions

View File

@@ -56,7 +56,7 @@ namespace SabreTools.Core
public static void SetConsoleHeader(string program)
{
// Dynamically create the header string, adapted from http://stackoverflow.com/questions/8200661/how-to-align-string-in-fixed-length-string
int width = Console.WindowWidth - 3;
int width = (Console.WindowWidth == 0 ? 80 : Console.WindowWidth) - 3;
string border = $"+{new string('-', width)}+";
string mid = $"{program} {Globals.Version}";
mid = $"|{mid.PadLeft(((width - mid.Length) / 2) + mid.Length).PadRight(width)}|";