mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Parser
- Code cleanup for ::findCommand.
This commit is contained in:
parent
ce914a31f9
commit
a2763a275c
1 changed files with 3 additions and 2 deletions
|
@ -435,14 +435,15 @@ void Parser::findCommand ()
|
||||||
std::vector <Tree*> nodes;
|
std::vector <Tree*> nodes;
|
||||||
collect (nodes, collectAll);
|
collect (nodes, collectAll);
|
||||||
|
|
||||||
// There can be only one.
|
|
||||||
// Scan for an existing CMD tag, to short-circuit scanning for another.
|
// Scan for an existing CMD tag, to short-circuit scanning for another.
|
||||||
|
// There can be only one.
|
||||||
std::vector <Tree*>::iterator i;
|
std::vector <Tree*>::iterator i;
|
||||||
for (i = nodes.begin (); i != nodes.end (); ++i)
|
for (i = nodes.begin (); i != nodes.end (); ++i)
|
||||||
if ((*i)->hasTag ("CMD"))
|
if ((*i)->hasTag ("CMD"))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// No CMD tag found, now look for a command.
|
// If no CMD tag was found, rescan all nodes and canonicalize args, looking
|
||||||
|
// for the first match.
|
||||||
std::string command;
|
std::string command;
|
||||||
for (i = nodes.begin (); i != nodes.end (); ++i)
|
for (i = nodes.begin (); i != nodes.end (); ++i)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue