reworked how we add args to list

This commit is contained in:
mes5k 2004-02-13 23:20:08 +00:00
parent cf0415b259
commit 4337d270db
2 changed files with 10 additions and 4 deletions

View File

@ -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 );
}
}

View File

@ -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;
}
}