diff --git a/include/tclap/CmdLine.h b/include/tclap/CmdLine.h index fc47ed8..0fec8d8 100644 --- a/include/tclap/CmdLine.h +++ b/include/tclap/CmdLine.h @@ -224,17 +224,15 @@ private: * not need to be called. * \param a - Argument to be added and xor'd. * \param b - Argument to be added and xor'd. - * \param required - Require at least one option (defaults to true) */ - void xorAdd( Arg& a, Arg& b, bool required=true ); + void xorAdd( Arg& a, Arg& b ); /** * Add a list of Args that will be xor'd. If this method is used, * add does not need to be called. * \param xors - List of Args to be added and xor'd. - * \param required - Require at least one option (defaults to true) */ - void xorAdd( std::vector& xors, bool required=true ); + void xorAdd( std::vector& xors ); /** * Parses the command line. @@ -392,25 +390,24 @@ inline void CmdLine::_constructor() deleteOnExit(v); } -inline void CmdLine::xorAdd( std::vector& ors, bool required ) +inline void CmdLine::xorAdd( std::vector& ors ) { _xorHandler.add( ors ); - for (ArgVectorIterator it = ors.begin(); it != ors.end(); it++) { - if (required) { - (*it)->forceRequired(); - (*it)->setRequireLabel( "OR required" ); - } + for (ArgVectorIterator it = ors.begin(); it != ors.end(); it++) + { + (*it)->forceRequired(); + (*it)->setRequireLabel( "OR required" ); add( *it ); } } -inline void CmdLine::xorAdd( Arg& a, Arg& b, bool required ) +inline void CmdLine::xorAdd( Arg& a, Arg& b ) { std::vector ors; ors.push_back( &a ); ors.push_back( &b ); - xorAdd( ors, required ); + xorAdd( ors ); } inline void CmdLine::add( Arg& a ) diff --git a/include/tclap/CmdLineInterface.h b/include/tclap/CmdLineInterface.h index 9f17d70..1b25e9b 100644 --- a/include/tclap/CmdLineInterface.h +++ b/include/tclap/CmdLineInterface.h @@ -67,17 +67,15 @@ class CmdLineInterface * not need to be called. * \param a - Argument to be added and xor'd. * \param b - Argument to be added and xor'd. - * \param required - Require at least one option (defaults to true) */ - virtual void xorAdd( Arg& a, Arg& b, bool required=true )=0; + virtual void xorAdd( Arg& a, Arg& b )=0; /** * Add a list of Args that will be xor'd. If this method is used, * add does not need to be called. * \param xors - List of Args to be added and xor'd. - * \param required - Require at least one option (defaults to true) */ - virtual void xorAdd( std::vector& xors, bool required=true )=0; + virtual void xorAdd( std::vector& xors )=0; /** * Parses the command line.