| 1407 | } |
| 1408 | |
| 1409 | int Session::applyCommandLine( int argc, char const * const * argv ) { |
| 1410 | if ( m_startupExceptions ) { return UnspecifiedErrorExitCode; } |
| 1411 | |
| 1412 | auto result = m_cli.parse( Clara::Args( argc, argv ) ); |
| 1413 | |
| 1414 | if( !result ) { |
| 1415 | config(); |
| 1416 | getCurrentMutableContext().setConfig(m_config.get()); |
| 1417 | auto errStream = makeStream( "%stderr" ); |
| 1418 | auto colour = makeColourImpl( ColourMode::PlatformDefault, errStream.get() ); |
| 1419 | |
| 1420 | errStream->stream() |
| 1421 | << colour->guardColour( Colour::Red ) |
| 1422 | << "\nError(s) in input:\n" |
| 1423 | << TextFlow::Column( result.errorMessage() ).indent( 2 ) |
| 1424 | << "\n\n"; |
| 1425 | errStream->stream() << "Run with -? for usage\n\n" << std::flush; |
| 1426 | return UnspecifiedErrorExitCode; |
| 1427 | } |
| 1428 | |
| 1429 | if( m_configData.showHelp ) |
| 1430 | showHelp(); |
| 1431 | if( m_configData.libIdentify ) |
| 1432 | libIdentify(); |
| 1433 | |
| 1434 | m_config.reset(); |
| 1435 | return 0; |
| 1436 | } |
| 1437 | |
| 1438 | #if defined(CATCH_CONFIG_WCHAR) && defined(_WIN32) && defined(UNICODE) |
| 1439 | int Session::applyCommandLine( int argc, wchar_t const * const * argv ) { |
no test coverage detected