reverted changes?

This commit is contained in:
Mike Smoot 2011-05-22 12:41:48 -07:00
parent fdce4f38f0
commit 2fee9bc48e
2 changed files with 11 additions and 16 deletions

View File

@ -224,17 +224,15 @@ private:
* not need to be called. * not need to be called.
* \param a - Argument to be added and xor'd. * \param a - Argument to be added and xor'd.
* \param b - 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 a list of Args that will be xor'd. If this method is used,
* add does not need to be called. * add does not need to be called.
* \param xors - List of Args to be added and xor'd. * \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<Arg*>& xors, bool required=true ); void xorAdd( std::vector<Arg*>& xors );
/** /**
* Parses the command line. * Parses the command line.
@ -392,25 +390,24 @@ inline void CmdLine::_constructor()
deleteOnExit(v); deleteOnExit(v);
} }
inline void CmdLine::xorAdd( std::vector<Arg*>& ors, bool required ) inline void CmdLine::xorAdd( std::vector<Arg*>& ors )
{ {
_xorHandler.add( ors ); _xorHandler.add( ors );
for (ArgVectorIterator it = ors.begin(); it != ors.end(); it++) { for (ArgVectorIterator it = ors.begin(); it != ors.end(); it++)
if (required) { {
(*it)->forceRequired(); (*it)->forceRequired();
(*it)->setRequireLabel( "OR required" ); (*it)->setRequireLabel( "OR required" );
}
add( *it ); add( *it );
} }
} }
inline void CmdLine::xorAdd( Arg& a, Arg& b, bool required ) inline void CmdLine::xorAdd( Arg& a, Arg& b )
{ {
std::vector<Arg*> ors; std::vector<Arg*> ors;
ors.push_back( &a ); ors.push_back( &a );
ors.push_back( &b ); ors.push_back( &b );
xorAdd( ors, required ); xorAdd( ors );
} }
inline void CmdLine::add( Arg& a ) inline void CmdLine::add( Arg& a )

View File

@ -67,17 +67,15 @@ class CmdLineInterface
* not need to be called. * not need to be called.
* \param a - Argument to be added and xor'd. * \param a - Argument to be added and xor'd.
* \param b - 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 a list of Args that will be xor'd. If this method is used,
* add does not need to be called. * add does not need to be called.
* \param xors - List of Args to be added and xor'd. * \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<Arg*>& xors, bool required=true )=0; virtual void xorAdd( std::vector<Arg*>& xors )=0;
/** /**
* Parses the command line. * Parses the command line.