>From 252403a2a937c15ccbfd86cde5ab1fe64aaacd4d Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 17 Nov 2014 02:38:07 +0100 Subject: [PATCH] Give correct usage message if the GUI test is ran with --help option. Handle "--help" command line option in the GUI test itself instead of just passing it through to the main LMI code in order to give help about the test-specific options such as "--list" and "--test". --- main_wx_test.cpp | 25 ++++++++++++++++++++++++- 1 files changed, 24 insertions(+), 1 deletions(-) diff --git a/main_wx_test.cpp b/main_wx_test.cpp index d24e9b6..d3da655 100644 --- a/main_wx_test.cpp +++ b/main_wx_test.cpp @@ -159,7 +159,7 @@ class application_test // // Return false if the program execution shouldn't continue, currently this // is only the case if the "list" option was specified requesting just to - // list the available tests. + // list the available tests or if the standard "help" option was given. bool process_command_line(int& argc, char* argv[]); // Run all the tests that were configured to be executed (all by default). @@ -325,6 +325,29 @@ bool application_test::process_command_line(int& argc, char* argv[]) last_test_option = arg; remove_arg(n, argc, argv); } + else if + ( + 0 == std::strcmp(arg, "-h") + || 0 == std::strcmp(arg, "--help") + ) + { + warning() + << "This is LMI GUI unit testing runner.\n" + "\n" + "Usage: " + << argv[0] + << "\n" + " -h, --help display this help and exit\n" + " -l, --list list all available tests and exit\n" + " -t or run only the specified test (all\n" + " --test tests are run by default); may be given\n" + " multiple times)\n" + "\n" + "Additionally, all command line options supported by the\n" + "main LMI executable are also supported." + << std::flush; + return false; + } else { n++; -- 1.7.9