mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
CLI
- Implemented ::categorize.
This commit is contained in:
parent
58afe23952
commit
343a79a034
1 changed files with 31 additions and 0 deletions
31
src/CLI.cpp
31
src/CLI.cpp
|
@ -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 (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue