| 7019 | } |
| 7020 | |
| 7021 | int applyCommandLine( int argc, char const* const* const argv, OnUnusedOptions::DoWhat unusedOptionBehaviour = OnUnusedOptions::Fail ) { |
| 7022 | try { |
| 7023 | m_cli.setThrowOnUnrecognisedTokens( unusedOptionBehaviour == OnUnusedOptions::Fail ); |
| 7024 | m_unusedTokens = m_cli.parseInto( Clara::argsToVector( argc, argv ), m_configData ); |
| 7025 | if( m_configData.showHelp ) |
| 7026 | showHelp( m_configData.processName ); |
| 7027 | m_config.reset(); |
| 7028 | } |
| 7029 | catch( std::exception& ex ) { |
| 7030 | { |
| 7031 | Colour colourGuard( Colour::Red ); |
| 7032 | Catch::cerr() |
| 7033 | << "\nError(s) in input:\n" |
| 7034 | << Text( ex.what(), TextAttributes().setIndent(2) ) |
| 7035 | << "\n\n"; |
| 7036 | } |
| 7037 | m_cli.usage( Catch::cout(), m_configData.processName ); |
| 7038 | return (std::numeric_limits<int>::max)(); |
| 7039 | } |
| 7040 | return 0; |
| 7041 | } |
| 7042 | |
| 7043 | void useConfigData( ConfigData const& _configData ) { |
| 7044 | m_configData = _configData; |
nothing calls this directly
no test coverage detected