mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-23 14:36:44 +02:00
Parser
- Implemented ::getCommand.
This commit is contained in:
parent
f908e2ae02
commit
ce7506f4fc
2 changed files with 18 additions and 1 deletions
|
@ -608,6 +608,23 @@ std::string Parser::getLimit () const
|
||||||
return "0";
|
return "0";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
std::string Parser::getCommand () const
|
||||||
|
{
|
||||||
|
std::vector <Tree*>::const_iterator i;
|
||||||
|
for (i = _tree->_branches.begin (); i != _tree->_branches.end (); ++i)
|
||||||
|
{
|
||||||
|
// Parser override operator.
|
||||||
|
if ((*i)->attribute ("canonical") == "TERMINATED")
|
||||||
|
break;
|
||||||
|
|
||||||
|
if ((*i)->hasTag ("CMD"))
|
||||||
|
return (*i)->attribute ("raw");
|
||||||
|
}
|
||||||
|
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
// /pattern/ --> description ~ pattern
|
// /pattern/ --> description ~ pattern
|
||||||
void Parser::findPattern ()
|
void Parser::findPattern ()
|
||||||
|
|
|
@ -59,9 +59,9 @@ public:
|
||||||
|
|
||||||
const std::string getFilterExpression ();
|
const std::string getFilterExpression ();
|
||||||
const std::vector <std::string> getWords () const;
|
const std::vector <std::string> getWords () const;
|
||||||
// TODO Extract modifications
|
|
||||||
|
|
||||||
std::string getLimit () const;
|
std::string getLimit () const;
|
||||||
|
std::string getCommand () const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void findTerminator ();
|
void findTerminator ();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue