mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
A3t
- Modified ::findCommand to scan for already-found commands, so as not to find a second, if the method is called again. - Fixed a bug where all likely commands were tagged, not just the first.
This commit is contained in:
parent
6cd6910968
commit
c5fd2700ef
1 changed files with 12 additions and 0 deletions
12
src/A3t.cpp
12
src/A3t.cpp
|
@ -233,8 +233,15 @@ void A3t::findTerminator ()
|
|||
// autoCompletes to a valid command/report.
|
||||
void A3t::findCommand ()
|
||||
{
|
||||
// There can be only one.
|
||||
// Scan for an existing CMD tag, to short-circuit scanning for another.
|
||||
std::string command;
|
||||
std::vector <Tree*>::iterator i;
|
||||
for (i = _tree->_branches.begin (); i != _tree->_branches.end (); ++i)
|
||||
if ((*i)->hasTag ("CMD"))
|
||||
return;
|
||||
|
||||
// No CMD tag found, now look for a command.
|
||||
for (i = _tree->_branches.begin (); i != _tree->_branches.end (); ++i)
|
||||
{
|
||||
// Parser override operator.
|
||||
|
@ -252,6 +259,7 @@ void A3t::findCommand ()
|
|||
(*i)->tag ("CMD");
|
||||
(*i)->tag ("REPORT");
|
||||
(*i)->attribute ("canonical", command);
|
||||
break;
|
||||
}
|
||||
*/
|
||||
|
||||
|
@ -261,6 +269,7 @@ void A3t::findCommand ()
|
|||
(*i)->tag ("CMD");
|
||||
(*i)->tag ("READCMD");
|
||||
(*i)->attribute ("canonical", command);
|
||||
break;
|
||||
}
|
||||
|
||||
else if (canonicalize (command, "writecmd", (*i)->attribute ("raw")))
|
||||
|
@ -269,6 +278,7 @@ void A3t::findCommand ()
|
|||
(*i)->tag ("CMD");
|
||||
(*i)->tag ("WRITECMD");
|
||||
(*i)->attribute ("canonical", command);
|
||||
break;
|
||||
}
|
||||
|
||||
else if (canonicalize (command, "helper", (*i)->attribute ("raw")))
|
||||
|
@ -277,6 +287,7 @@ void A3t::findCommand ()
|
|||
(*i)->tag ("CMD");
|
||||
(*i)->tag ("HELPER");
|
||||
(*i)->attribute ("canonical", command);
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -286,6 +297,7 @@ void A3t::findCommand ()
|
|||
(*i)->tag ("CMD");
|
||||
(*i)->tag ("SPECIALCMD");
|
||||
(*i)->attribute ("canonical", command);
|
||||
break;
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue