From e45e3a139ad46de2a38549d877e2ec0b2be5bdab Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Mon, 23 Dec 2013 10:24:06 +0000 Subject: [PATCH] =?UTF-8?q?Clara=20ignores=20anything=20after=20a=20lone?= =?UTF-8?q?=20=E2=80=94=20(double=20dash)=20-=20this=20allows=20use=20with?= =?UTF-8?q?in=20an=20environment=20that=20appends=20additional=20arguments?= =?UTF-8?q?=20that=20Clara=20will=20otherwise=20reject=20-=20generated=20b?= =?UTF-8?q?uild=2023?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- include/internal/catch_version.hpp | 2 +- include/internal/clara.h | 3 ++- single_include/catch.hpp | 9 +++++---- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 8852fd7a..dba8e0c2 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ![catch logo](catch-logo-small.png) -*v1.0 build 22 (master branch)* +*v1.0 build 23 (master branch)* Build status (on Travis CI) [![Build Status](https://travis-ci.org/philsquared/Catch.png)](https://travis-ci.org/philsquared/Catch) diff --git a/include/internal/catch_version.hpp b/include/internal/catch_version.hpp index 8b232e99..f615b3ea 100644 --- a/include/internal/catch_version.hpp +++ b/include/internal/catch_version.hpp @@ -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 diff --git a/include/internal/clara.h b/include/internal/clara.h index 9f736e99..b44d129a 100644 --- a/include/internal/clara.h +++ b/include/internal/clara.h @@ -206,7 +206,8 @@ namespace Clara { }; void parseIntoTokens( int argc, char const * const * argv, std::vector& 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& tokens ) const { diff --git a/single_include/catch.hpp b/single_include/catch.hpp index 1acc3beb..770b3537 100644 --- a/single_include/catch.hpp +++ b/single_include/catch.hpp @@ -1,6 +1,6 @@ /* - * CATCH v1.0 build 22 (master branch) - * Generated: 2013-12-20 19:06:10.591489 + * CATCH v1.0 build 23 (master branch) + * Generated: 2013-12-23 10:22:45.547645 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. @@ -3224,7 +3224,8 @@ namespace Clara { }; void parseIntoTokens( int argc, char const * const * argv, std::vector& 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& tokens ) const { @@ -6178,7 +6179,7 @@ namespace Catch { namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 1, 0, 22, "master" ); + Version libraryVersion( 1, 0, 23, "master" ); } // #included from: catch_text.hpp