mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Expression reboot
- More integration of A3 into Context. - Now ready for filter/modification/word extraction.
This commit is contained in:
parent
4fc4e0f637
commit
abcda0bcfa
4 changed files with 41 additions and 22 deletions
44
src/A3.cpp
44
src/A3.cpp
|
@ -495,6 +495,34 @@ const std::vector <std::string> A3::list () const
|
|||
return all;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
bool A3::find_command (std::string& command) const
|
||||
{
|
||||
std::vector <Arg>::const_iterator arg;
|
||||
for (arg = this->begin (); arg != this->end (); ++arg)
|
||||
{
|
||||
if (arg->_category == "command")
|
||||
{
|
||||
command = arg->_raw;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
const std::string A3::find_limit () const
|
||||
{
|
||||
std::vector <Arg>::const_reverse_iterator arg;
|
||||
for (arg = this->rbegin (); arg != this->rend (); ++arg)
|
||||
if (arg->_raw.find ("limit:") != std::string::npos)
|
||||
return arg->_raw.substr (6);
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -519,22 +547,6 @@ std::vector <std::string> A3::operator_list ()
|
|||
return all;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
bool A3::find_command (std::string& command)
|
||||
{
|
||||
std::vector <Arg>::iterator arg;
|
||||
for (arg = this->begin (); arg != this->end (); ++arg)
|
||||
{
|
||||
if (arg->_third == "command")
|
||||
{
|
||||
command = arg->_first;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
std::string A3::find_limit ()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue