From 9ad3497b9b1768b10fa5436ba0d525e22687ff73 Mon Sep 17 00:00:00 2001 From: hytracer Date: Tue, 21 Nov 2023 20:40:11 +0100 Subject: [PATCH 1/2] feat: handle debugging flag on CLI --- WiiLink-Patcher-CLI/WiiLink_Patcher.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/WiiLink-Patcher-CLI/WiiLink_Patcher.cs b/WiiLink-Patcher-CLI/WiiLink_Patcher.cs index e9e5a56..b1adac3 100644 --- a/WiiLink-Patcher-CLI/WiiLink_Patcher.cs +++ b/WiiLink-Patcher-CLI/WiiLink_Patcher.cs @@ -44,7 +44,7 @@ class WiiLink_Patcher static string curCmd = ""; static readonly string curDir = Directory.GetCurrentDirectory(); static readonly string tempDir = Path.Join(Path.GetTempPath(), "WiiLink_Patcher"); - static readonly bool DEBUG_MODE = false; + static bool DEBUG_MODE = false; static PatcherLanguage patcherLang = PatcherLanguage.en; static JObject? localizedText = null; @@ -3977,6 +3977,12 @@ static void ExitApp() static async System.Threading.Tasks.Task Main(string[] args) { + // Check for debugging flag + bool debugArgExists = Array.Exists(args, element => element.ToLower() == "--debug"); + + // Set DEBUG_MODE + DEBUG_MODE = debugArgExists; + // Set console encoding to UTF-8 Console.OutputEncoding = Encoding.UTF8; From a1bed60b99353a4fd3a5a9fb3b1ac7ca3223b20d Mon Sep 17 00:00:00 2001 From: hytracer Date: Tue, 21 Nov 2023 20:42:24 +0100 Subject: [PATCH 2/2] chore: add debugging information to README --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 28223fc..f7ad421 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,12 @@ You can download the latest version of the patcher from the [Releases Page](http Compatible with Windows (**10** and **11**), macOS, and Linux! +### Debug +In order to troubleshoot any issues, you can use the `--debug` flag while running the patcher to have extended logs. +``` +> --debug +``` + ## Compiling Clone or download the repository, and open the solution file in Visual Studio. You will need to make sure you have .NET 6.0 set up to compile it.