| 13220 | } |
| 13221 | |
| 13222 | int Session::applyCommandLine( int argc, char const * const * argv ) { |
| 13223 | if( m_startupExceptions ) |
| 13224 | return 1; |
| 13225 | |
| 13226 | auto result = m_cli.parse( clara::Args( argc, argv ) ); |
| 13227 | if( !result ) { |
| 13228 | config(); |
| 13229 | getCurrentMutableContext().setConfig(m_config); |
| 13230 | Catch::cerr() |
| 13231 | << Colour( Colour::Red ) |
| 13232 | << "\nError(s) in input:\n" |
| 13233 | << Column( result.errorMessage() ).indent( 2 ) |
| 13234 | << "\n\n"; |
| 13235 | Catch::cerr() << "Run with -? for usage\n" << std::endl; |
| 13236 | return MaxExitCode; |
| 13237 | } |
| 13238 | |
| 13239 | if( m_configData.showHelp ) |
| 13240 | showHelp(); |
| 13241 | if( m_configData.libIdentify ) |
| 13242 | libIdentify(); |
| 13243 | m_config.reset(); |
| 13244 | return 0; |
| 13245 | } |
| 13246 | |
| 13247 | #if defined(CATCH_CONFIG_WCHAR) && defined(_WIN32) && defined(UNICODE) |
| 13248 | int Session::applyCommandLine( int argc, wchar_t const * const * argv ) { |