>From 41c0ebfd6ffc0a463e97d8334ce1f294f1f2e9e9 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 5 Dec 2014 18:58:56 +0100 Subject: [PATCH 1/2] Show command line help in a plain message box. Don't use warning() for showing it, as help shown in response to "--help" option is not an error, not a warning, but just the normal and expected program output. --- main_wx_test.cpp | 7 +++++-- skeleton.cpp | 6 ++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/main_wx_test.cpp b/main_wx_test.cpp index df768f9..c9922bf 100644 --- a/main_wx_test.cpp +++ b/main_wx_test.cpp @@ -41,6 +41,7 @@ #include #include #include // wxEntry() +#include #include #include #include @@ -334,7 +335,8 @@ bool application_test::process_command_line(int& argc, char* argv[]) || 0 == std::strcmp(arg, "--help") ) { - warning() + wxString usage; + usage << "Run automated GUI tests.\n" "\n" "Usage: " @@ -347,7 +349,8 @@ bool application_test::process_command_line(int& argc, char* argv[]) "\n" "Additionally, all command line options supported by the\n" "main lmi executable are also supported." - << std::flush; + ; + wxMessageBox(usage, "Command Line Help"); return false; } else diff --git a/skeleton.cpp b/skeleton.cpp index 8a3f7fe..d08235f 100644 --- a/skeleton.cpp +++ b/skeleton.cpp @@ -95,6 +95,7 @@ #include #include // wxSafeShowMessage() #include +#include #include #include // wxGetTextFromUser() #include @@ -1303,8 +1304,9 @@ bool Skeleton::ProcessCommandLine(int argc, char* argv[]) if(show_help) { - getopt_long.usage(warning()); - warning() << std::flush; + std::ostringstream oss; + getopt_long.usage(oss); + wxMessageBox(oss.str(), "Command Line Help"); return false; } -- 1.7.9