mirror of
https://github.com/catchorg/Catch2.git
synced 2025-05-25 14:09:26 +00:00
Refactored command line parsers into polymorphic classes
This commit is contained in:
parent
95ae50ad3d
commit
eb775aa7af
3 changed files with 325 additions and 103 deletions
|
@ -173,7 +173,9 @@ namespace Catch {
|
|||
|
||||
try {
|
||||
CommandParser parser( argc, argv );
|
||||
|
||||
|
||||
AllOptions options;
|
||||
|
||||
if( Command cmd = parser.find( "-h", "-?", "--help" ) ) {
|
||||
if( cmd.argsCount() != 0 )
|
||||
cmd.raiseError( "Does not accept arguments" );
|
||||
|
@ -183,7 +185,7 @@ namespace Catch {
|
|||
return 0;
|
||||
}
|
||||
|
||||
parseIntoConfig( parser, config.data() );
|
||||
options.parseIntoConfig( parser, config.data() );
|
||||
}
|
||||
catch( std::exception& ex ) {
|
||||
std::cerr << ex.what() << "\n\nUsage: ...\n\n";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue