| 10758 | } |
| 10759 | |
| 10760 | int Session::applyCommandLine( int argc, char const * const * argv ) { |
| 10761 | if( m_startupExceptions ) |
| 10762 | return 1; |
| 10763 | |
| 10764 | auto result = m_cli.parse( clara::Args( argc, argv ) ); |
| 10765 | config(); |
| 10766 | getCurrentMutableContext().setConfig( m_config ); |
| 10767 | if( !result ) { |
| 10768 | Catch::cerr() |
| 10769 | << Colour( Colour::Red ) |
| 10770 | << "\nError(s) in input:\n" |
| 10771 | << Column( result.errorMessage() ).indent( 2 ) |
| 10772 | << "\n\n"; |
| 10773 | Catch::cerr() << "Run with -? for usage\n" << std::endl; |
| 10774 | return MaxExitCode; |
| 10775 | } |
| 10776 | |
| 10777 | if( m_configData.showHelp ) |
| 10778 | showHelp(); |
| 10779 | if( m_configData.libIdentify ) |
| 10780 | libIdentify(); |
| 10781 | m_config.reset(); |
| 10782 | return 0; |
| 10783 | } |
| 10784 | |
| 10785 | #if defined(CATCH_CONFIG_WCHAR) && defined(WIN32) && defined(UNICODE) |
| 10786 | int Session::applyCommandLine( int argc, wchar_t const * const * argv ) { |