mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Integration - tag parsing
- Added +tag, -tag support to Context. - Unit tests still broken. - Task is still broken.
This commit is contained in:
parent
bf4cf8e786
commit
72e3f76ed9
2 changed files with 21 additions and 8 deletions
|
@ -215,6 +215,7 @@ void Context::dispatch ()
|
|||
|
||||
return out;
|
||||
*/
|
||||
throw std::string ("unimplemented Context::dispatch");
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -328,6 +329,8 @@ void Context::loadCorrectConfigFile ()
|
|||
void Context::parse ()
|
||||
{
|
||||
Att attribute;
|
||||
tagAdditions.clear ();
|
||||
tagRemovals.clear ();
|
||||
std::string descCandidate = "";
|
||||
bool terminated = false;
|
||||
bool foundSequence = false;
|
||||
|
@ -355,19 +358,27 @@ std::cout << "# parse sequence '" << *arg << "'" << std::endl;
|
|||
foundSequence = true;
|
||||
}
|
||||
|
||||
/*
|
||||
// Tags begin with + or - and contain arbitrary text.
|
||||
else if (validTag (arg))
|
||||
// Tags to include begin with '+'.
|
||||
else if (arg->length () > 1 &&
|
||||
(*arg)[0] == '+')
|
||||
{
|
||||
std::cout << "# parse tag addition '" << *arg << "'" << std::endl;
|
||||
if (foundSequence)
|
||||
foundSomethingAfterSequence = true;
|
||||
|
||||
if (arg[0] == '+')
|
||||
task.addTag (arg->substr (1, std::string::npos));
|
||||
else if (arg[0] == '-')
|
||||
task.addRemoveTag (arg->substr (1, std::string::npos));
|
||||
tagAdditions.push_back (arg->substr (1, std::string::npos));
|
||||
}
|
||||
|
||||
// Tags to remove begin with '-'.
|
||||
else if (arg->length () > 1 &&
|
||||
(*arg)[0] == '-')
|
||||
{
|
||||
std::cout << "# parse tag removal '" << *arg << "'" << std::endl;
|
||||
if (foundSequence)
|
||||
foundSomethingAfterSequence = true;
|
||||
|
||||
tagRemovals.push_back (arg->substr (1, std::string::npos));
|
||||
}
|
||||
*/
|
||||
|
||||
else if (attribute.valid (*arg))
|
||||
{
|
||||
|
|
|
@ -68,6 +68,8 @@ public:
|
|||
std::string program;
|
||||
std::vector <std::string> args;
|
||||
Cmd cmd;
|
||||
std::vector <std::string> tagAdditions;
|
||||
std::vector <std::string> tagRemovals;
|
||||
|
||||
private:
|
||||
std::vector <std::string> messages;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue