- Implemented ::categorize.
This commit is contained in:
Paul Beckingham 2014-10-14 00:49:02 -04:00
parent 58afe23952
commit 343a79a034

View file

@ -141,6 +141,37 @@ void CLI::aliasExpansion ()
dump ("CLI::aliasExpansion");
}
////////////////////////////////////////////////////////////////////////////////
void CLI::categorize ()
{
bool foundCommand = false;
_filter.clear ();
_modifications.clear ();
_command = "";
_readOnly = false;
std::vector <std::string>::iterator i;
for (i = _args.begin (); i != _args.end (); ++i)
{
if (canonicalize (_command, "cmd", *i))
{
foundCommand = true;
_readOnly = ! exactMatch ("writecmd", _command);
}
else if (foundCommand && ! _readOnly)
{
_modifications.push_back (*i);
}
else
{
_filter.push_back (*i);
}
}
dump ("CLI::categorize");
}
////////////////////////////////////////////////////////////////////////////////
// Search for exact 'value' in _entities category.
bool CLI::exactMatch (