diff options
| author | Tristan Stenner | 2020-02-15 20:42:57 +0100 |
|---|---|---|
| committer | Martin Hořeňovský | 2020-02-16 16:11:11 +0100 |
| commit | 6a2c025bfc9fdac3d99e6f54c790bc04d0ca8174 (patch) | |
| tree | fed92cba0c89083a7f689dd9c0c4894579a1c968 /src | |
| parent | 2441c2faab1a4f7bbd087d38027d087b303ea989 (diff) | |
| download | catch3-6a2c025bfc9fdac3d99e6f54c790bc04d0ca8174.tar.gz | |
Add command line option 'never' to --wait-for-keypress (#1866)
Co-authored-by: Martin Hořeňovský <martin.horenovsky@gmail.com>
Diffstat (limited to 'src')
| -rw-r--r-- | src/catch2/catch_commandline.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/catch2/catch_commandline.cpp b/src/catch2/catch_commandline.cpp index 3c453f48..6ed626a1 100644 --- a/src/catch2/catch_commandline.cpp +++ b/src/catch2/catch_commandline.cpp @@ -91,14 +91,16 @@ namespace Catch { }; auto const setWaitForKeypress = [&]( std::string const& keypress ) { auto keypressLc = toLower( keypress ); - if( keypressLc == "start" ) + if (keypressLc == "never") + config.waitForKeypress = WaitForKeypress::Never; + else if( keypressLc == "start" ) config.waitForKeypress = WaitForKeypress::BeforeStart; else if( keypressLc == "exit" ) config.waitForKeypress = WaitForKeypress::BeforeExit; else if( keypressLc == "both" ) config.waitForKeypress = WaitForKeypress::BeforeStartAndExit; else - return ParserResult::runtimeError( "keypress argument must be one of: start, exit or both. '" + keypress + "' not recognised" ); + return ParserResult::runtimeError( "keypress argument must be one of: never, start, exit or both. '" + keypress + "' not recognised" ); return ParserResult::ok( ParseResultType::Matched ); }; auto const setVerbosity = [&]( std::string const& verbosity ) { @@ -195,7 +197,7 @@ namespace Catch { | Opt( config.libIdentify ) ["--libidentify"] ( "report name and version according to libidentify standard" ) - | Opt( setWaitForKeypress, "start|exit|both" ) + | Opt( setWaitForKeypress, "never|start|exit|both" ) ["--wait-for-keypress"] ( "waits for a keypress before exiting" ) | Opt( config.benchmarkSamples, "samples" ) |