Clara ignores anything after a lone — (double dash)

- this allows use within an environment that appends additional arguments that Clara will otherwise reject
- generated build 23
This commit is contained in:
Phil Nash
2013-12-23 10:24:06 +00:00
parent 91ef5f7d40
commit e45e3a139a
4 changed files with 9 additions and 7 deletions

View File

@@ -13,7 +13,7 @@
namespace Catch {
// These numbers are maintained by a script
Version libraryVersion( 1, 0, 22, "master" );
Version libraryVersion( 1, 0, 23, "master" );
}
#endif // TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED

View File

@@ -206,7 +206,8 @@ namespace Clara {
};
void parseIntoTokens( int argc, char const * const * argv, std::vector<Parser::Token>& tokens ) const {
for( int i = 1; i < argc; ++i )
const std::string doubleDash = "--";
for( int i = 1; i < argc && argv[i] != doubleDash; ++i )
parseIntoTokens( argv[i] , tokens);
}
void parseIntoTokens( std::string arg, std::vector<Parser::Token>& tokens ) const {