From dcab16998729dbe04520a6156be9fdae764695e0 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sat, 7 Jun 2014 12:50:39 -0400 Subject: [PATCH] CmdDenotate - Corrected use of command line arguments for a pattern - now uses modification args instead of all words. --- src/commands/CmdDenotate.cpp | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/src/commands/CmdDenotate.cpp b/src/commands/CmdDenotate.cpp index 59a7c1ca3..990c567ca 100644 --- a/src/commands/CmdDenotate.cpp +++ b/src/commands/CmdDenotate.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -63,18 +64,26 @@ int CmdDenotate::execute (std::string& output) return 1; } - // Apply the command line modifications to the completed task. - std::vector 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 ::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 projectChanges; - //std::string pattern = words.combine (); - std::string pattern; - join (pattern, " ", words); - std::vector ::iterator task; for (task = filtered.begin (); task != filtered.end (); ++task) {