| 12815 | } |
| 12816 | |
| 12817 | int Session::applyCommandLine( int argc, char const * const * argv ) { |
| 12818 | if( m_startupExceptions ) |
| 12819 | return 1; |
| 12820 | |
| 12821 | auto result = m_cli.parse( clara::Args( argc, argv ) ); |
| 12822 | if( !result ) { |
| 12823 | config(); |
| 12824 | getCurrentMutableContext().setConfig(m_config); |
| 12825 | Catch::cerr() |
| 12826 | << Colour( Colour::Red ) |
| 12827 | << "\nError(s) in input:\n" |
| 12828 | << Column( result.errorMessage() ).indent( 2 ) |
| 12829 | << "\n\n"; |
| 12830 | Catch::cerr() << "Run with -? for usage\n" << std::endl; |
| 12831 | return MaxExitCode; |
| 12832 | } |
| 12833 | |
| 12834 | if( m_configData.showHelp ) |
| 12835 | showHelp(); |
| 12836 | if( m_configData.libIdentify ) |
| 12837 | libIdentify(); |
| 12838 | m_config.reset(); |
| 12839 | return 0; |
| 12840 | } |
| 12841 | |
| 12842 | #if defined(CATCH_CONFIG_WCHAR) && defined(_WIN32) && defined(UNICODE) |
| 12843 | int Session::applyCommandLine( int argc, wchar_t const * const * argv ) { |