From a849a2b9caee3e004d3af7ada55b384392e4e81b Mon Sep 17 00:00:00 2001 From: zeromus Date: Mon, 6 Jun 2011 21:08:38 +0000 Subject: [PATCH] fix debug stdout redirection with a hack. which visual studio doesnt support in c# ???? --- BizHawk.MultiClient/MainForm.cs | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/BizHawk.MultiClient/MainForm.cs b/BizHawk.MultiClient/MainForm.cs index 8f5eed96eb..c671e9f7dc 100644 --- a/BizHawk.MultiClient/MainForm.cs +++ b/BizHawk.MultiClient/MainForm.cs @@ -111,14 +111,23 @@ namespace BizHawk.MultiClient string cmdLoadState = null; string cmdMovie = null; for (int i = 0; i < args.Length; i++) - { + { + //for some reason sometimes visual studio will pass this to us on the commandline. it makes no sense. + if (args[i] == ">") + { + i++; + string stdout = args[i]; + Console.SetOut(new StreamWriter(stdout)); + continue; + } + string arg = args[i].ToLower(); - if (arg.StartsWith("--load-slot=")) - cmdLoadState = arg.Substring(arg.IndexOf('=') + 1); - else if (arg.StartsWith("--movie=")) - cmdMovie = arg.Substring(arg.IndexOf('=') + 1); - else - cmdRom = arg; + if (arg.StartsWith("--load-slot=")) + cmdLoadState = arg.Substring(arg.IndexOf('=') + 1); + else if (arg.StartsWith("--movie=")) + cmdMovie = arg.Substring(arg.IndexOf('=') + 1); + else + cmdRom = arg; } if (cmdRom != null)