CmdDenotate

- Corrected use of command line arguments for a pattern - now uses
  modification args instead of all words.
This commit is contained in:
Paul Beckingham 2014-06-07 12:50:39 -04:00
parent 85481e3e69
commit dcab169987

View file

@ -27,6 +27,7 @@
#include <cmake.h>
#include <iostream>
#include <Context.h>
#include <Tree.h>
#include <Filter.h>
#include <text.h>
#include <util.h>
@ -63,18 +64,26 @@ int CmdDenotate::execute (std::string& output)
return 1;
}
// Apply the command line modifications to the completed task.
std::vector <std::string> words = context.parser.getWords ();
if (!words.size ())
throw std::string (STRING_CMD_DENO_WORDS);
// Extract all the ORIGINAL MODIFICATION args as simple text patter.
std::string pattern = "";
std::vector <Tree*>::iterator arg;
for (arg = context.parser.tree ()->_branches.begin ();
arg != context.parser.tree ()->_branches.end ();
++arg)
{
if ((*arg)->hasTag ("ORIGINAL") &&
(*arg)->hasTag ("MODIFICATION"))
{
if (pattern != "")
pattern += ' ';
pattern += (*arg)->attribute ("raw");
}
}
// Accumulated project change notifications.
std::map <std::string, std::string> projectChanges;
//std::string pattern = words.combine ();
std::string pattern;
join (pattern, " ", words);
std::vector <Task>::iterator task;
for (task = filtered.begin (); task != filtered.end (); ++task)
{