mirror of
https://github.com/cuberite/TCLAP.git
synced 2025-09-11 05:04:41 -04:00
reworked how we add args to list
This commit is contained in:
parent
cf0415b259
commit
4337d270db
@ -290,4 +290,12 @@ void Arg::xorSet()
|
||||
_xorSet = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Overridden by Args that need to added to the end of the list.
|
||||
*/
|
||||
void Arg::addToList( list<Arg*>& argList ) const
|
||||
{
|
||||
argList.push_front( (Arg*)this );
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -101,10 +101,7 @@ void CmdLine::add( Arg* a )
|
||||
return;
|
||||
}
|
||||
|
||||
if ( a->getFlag() == "" )
|
||||
_argList.push_back( a );
|
||||
else
|
||||
_argList.push_front( a );
|
||||
a->addToList( _argList );
|
||||
|
||||
if ( a->isRequired() ) _numRequired++;
|
||||
|
||||
@ -201,4 +198,5 @@ bool CmdLine::_emptyCombined(const string& s)
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user