Function applyCommandLine

Synopsis

#include <include/internal/catch_session.h>

int applyCommandLine(int argc, char const *const *argv)

Description

No description yet.

Mentioned in

Source

Lines 192-215 in include/internal/catch_session.cpp. Line 28 in include/internal/catch_session.h.

int Session::applyCommandLine( int argc, char const * const * argv ) {
    if( m_startupExceptions )
        return 1;
    auto result = m_cli.parse( clara::Args( argc, argv ) );
    if( !result ) {
        config();
        getCurrentMutableContext().setConfig(m_config);
        Catch::cerr()
            << Colour( Colour::Red )
            << "\nError(s) in input:\n"
            << Column( result.errorMessage() ).indent( 2 )
            << "\n\n";
        Catch::cerr() << "Run with -? for usage\n" << std::endl;
        return MaxExitCode;
    }
    if( m_configData.showHelp )
        showHelp();
    if( m_configData.libIdentify )
        libIdentify();
    m_config.reset();
    return 0;
}





Add Discussion as Guest

Log in