Skip to content

Commit e17d37a

Browse files
authored
Merge pull request #80 from WiiLink24/debug-cli
feat: debug command-line flag
2 parents bf2c183 + a1bed60 commit e17d37a

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ You can download the latest version of the patcher from the [Releases Page](http
2525
2626
Compatible with Windows (**10** and **11**), macOS, and Linux!
2727

28+
### Debug
29+
In order to troubleshoot any issues, you can use the `--debug` flag while running the patcher to have extended logs.
30+
```
31+
> <patcher executable> --debug
32+
```
33+
2834
## Compiling
2935

3036
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.

WiiLink-Patcher-CLI/WiiLink_Patcher.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class WiiLink_Patcher
4444
static string curCmd = "";
4545
static readonly string curDir = Directory.GetCurrentDirectory();
4646
static readonly string tempDir = Path.Join(Path.GetTempPath(), "WiiLink_Patcher");
47-
static readonly bool DEBUG_MODE = false;
47+
static bool DEBUG_MODE = false;
4848
static PatcherLanguage patcherLang = PatcherLanguage.en;
4949
static JObject? localizedText = null;
5050

@@ -3977,6 +3977,12 @@ static void ExitApp()
39773977

39783978
static async System.Threading.Tasks.Task Main(string[] args)
39793979
{
3980+
// Check for debugging flag
3981+
bool debugArgExists = Array.Exists(args, element => element.ToLower() == "--debug");
3982+
3983+
// Set DEBUG_MODE
3984+
DEBUG_MODE = debugArgExists;
3985+
39803986
// Set console encoding to UTF-8
39813987
Console.OutputEncoding = Encoding.UTF8;
39823988

0 commit comments

Comments
 (0)