| 6916 | } |
| 6917 | |
| 6918 | int applyCommandLine( int argc, char const* const* const argv, OnUnusedOptions::DoWhat unusedOptionBehaviour = OnUnusedOptions::Fail ) { |
| 6919 | try { |
| 6920 | m_cli.setThrowOnUnrecognisedTokens( unusedOptionBehaviour == OnUnusedOptions::Fail ); |
| 6921 | m_unusedTokens = m_cli.parseInto( Clara::argsToVector( argc, argv ), m_configData ); |
| 6922 | if( m_configData.showHelp ) |
| 6923 | showHelp( m_configData.processName ); |
| 6924 | m_config.reset(); |
| 6925 | } |
| 6926 | catch( std::exception& ex ) { |
| 6927 | { |
| 6928 | Colour colourGuard( Colour::Red ); |
| 6929 | Catch::cerr() |
| 6930 | << "\nError(s) in input:\n" |
| 6931 | << Text( ex.what(), TextAttributes().setIndent(2) ) |
| 6932 | << "\n\n"; |
| 6933 | } |
| 6934 | m_cli.usage( Catch::cout(), m_configData.processName ); |
| 6935 | return (std::numeric_limits<int>::max)(); |
| 6936 | } |
| 6937 | return 0; |
| 6938 | } |
| 6939 | |
| 6940 | void useConfigData( ConfigData const& _configData ) { |
| 6941 | m_configData = _configData; |
nothing calls this directly
no test coverage detected