From 05045f9702d201e80c3bb46aaa40ce378c9b9909 Mon Sep 17 00:00:00 2001 From: TheGreatRambler <31906920+TheGreatRambler@users.noreply.github.com> Date: Wed, 13 Nov 2019 19:59:27 -0500 Subject: [PATCH 1/2] Update ArgParser.cs --- BizHawk.Client.EmuHawk/ArgParser.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/BizHawk.Client.EmuHawk/ArgParser.cs b/BizHawk.Client.EmuHawk/ArgParser.cs index 42df6369ae..d97ac32c79 100644 --- a/BizHawk.Client.EmuHawk/ArgParser.cs +++ b/BizHawk.Client.EmuHawk/ArgParser.cs @@ -28,6 +28,7 @@ namespace BizHawk.Client.EmuHawk public bool startFullscreen = false; public string luaScript = null; public bool luaConsole = false; + public bool printVersion = false; public int socket_port = 0; public string socket_ip = null; public string mmf_filename = null; @@ -83,6 +84,10 @@ namespace BizHawk.Client.EmuHawk // automatically set dump length to maximum frame _autoDumpLength = _currAviWriterFrameList.OrderBy(x => x).Last(); } + else if (arg.StartsWith("--version")) + { + printVersion = true; + } else if (arg.StartsWith("--dump-name=")) { cmdDumpName = args[i].Substring(args[i].IndexOf('=') + 1); @@ -191,4 +196,4 @@ namespace BizHawk.Client.EmuHawk { } } -} \ No newline at end of file +} From 3b3cd3d2fdb040e720dbe80593e21338d2d47058 Mon Sep 17 00:00:00 2001 From: TheGreatRambler <31906920+TheGreatRambler@users.noreply.github.com> Date: Wed, 13 Nov 2019 20:05:46 -0500 Subject: [PATCH 2/2] Update MainForm.cs --- BizHawk.Client.EmuHawk/MainForm.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/BizHawk.Client.EmuHawk/MainForm.cs b/BizHawk.Client.EmuHawk/MainForm.cs index 68e61a66f9..0d6329802f 100644 --- a/BizHawk.Client.EmuHawk/MainForm.cs +++ b/BizHawk.Client.EmuHawk/MainForm.cs @@ -448,6 +448,15 @@ namespace BizHawk.Client.EmuHawk _needsFullscreenOnLoad = false; ToggleFullscreen(); } + + // Simply exit the program if the version is asked for + if (_argParser.printVersion) + { + // Print the version + Console.WriteLine(VersionInfo.GetEmuVersion()); + // Return and leave + return _exitCode; + } // incantation required to get the program reliably on top of the console window // we might want it in ToggleFullscreen later, but here, it needs to happen regardless