diff options
| author | Tristan Stenner | 2020-02-15 20:42:57 +0100 |
|---|---|---|
| committer | GitHub | 2020-02-15 20:42:57 +0100 |
| commit | 200b8b6fc05934149d9d4fa56eefbfd613ee73ea (patch) | |
| tree | 97ad634970eb8cca482ec34dfbc9a06aa4dec263 /include | |
| parent | e70fd2a4b9a867c57c215b73d28bf911333bf45c (diff) | |
| download | catch3-200b8b6fc05934149d9d4fa56eefbfd613ee73ea.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 'include')
| -rw-r--r-- | include/internal/catch_commandline.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/include/internal/catch_commandline.cpp b/include/internal/catch_commandline.cpp index b0412d50..a4010850 100644 --- a/include/internal/catch_commandline.cpp +++ b/include/internal/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 ) { @@ -198,7 +200,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" ) |