feat: command line debug option

This commit is contained in:
2026-02-26 11:15:50 +03:00
parent 2f2fc99662
commit facfc791c2
2 changed files with 31 additions and 12 deletions
+15 -1
View File
@@ -22,11 +22,25 @@ public partial class Program
private static void Ui(ParseResult parseResult)
{
var builder = BuildAvaloniaApp();
var fullscreen = parseResult.GetValue(_fullscreen);
var debug = parseResult.GetValue(_debug);
var renderingMode = parseResult.GetValue(_renderingMode);
var hideConsole = parseResult.GetValue(_hideConsole);
var fullscreen = parseResult.GetValue(_fullscreen);
IsFullscreen = fullscreen;
#if DEBUG
if (debug && !System.Diagnostics.Debugger.IsAttached)
{
Console.WriteLine("Waiting debugger attach");
Console.WriteLine($"ProcessId: {Environment.ProcessPath} [{Environment.ProcessId}]");
Console.WriteLine($"Thread: {Thread.CurrentThread.Name} [{Thread.CurrentThread.ManagedThreadId}]");
while (!System.Diagnostics.Debugger.IsAttached)
Thread.Sleep(100);
System.Diagnostics.Debugger.Break();
}
#endif
if (hideConsole)
SilenceConsole();