Skip to content

Commit

Permalink
Merge pull request #80 from WiiLink24/debug-cli
Browse files Browse the repository at this point in the history
feat: debug command-line flag
  • Loading branch information
PablosCorner authored Nov 21, 2023
2 parents bf2c183 + a1bed60 commit e17d37a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
```
> <patcher executable> --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.
Expand Down
8 changes: 7 additions & 1 deletion WiiLink-Patcher-CLI/WiiLink_Patcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit e17d37a

Please sign in to comment.