From 22c4136b7231a5f88d008eb3a4366326c0e50d15 Mon Sep 17 00:00:00 2001 From: Heath Stewart Date: Fri, 29 Apr 2022 14:30:51 -0700 Subject: [PATCH] Initialize console after parsing arguments (#263) Fixes #262 --- src/vswhere/Program.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/vswhere/Program.cpp b/src/vswhere/Program.cpp index 6ec7eab..6ee590d 100644 --- a/src/vswhere/Program.cpp +++ b/src/vswhere/Program.cpp @@ -17,7 +17,6 @@ int wmain(_In_ int argc, _In_ LPCWSTR argv[]) Console console(args); Module queryModule; - console.Initialize(); try { CoInitializer init; @@ -37,6 +36,8 @@ int wmain(_In_ int argc, _In_ LPCWSTR argv[]) queryModule.FromIUnknown(static_cast(query)); args.Parse(argc, argv); + console.Initialize(); + if (args.get_Help()) { WriteLogo(args, console, queryModule);