mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-20 04:13:07 +02:00
CLI
- Implemented ::findStrayModifications to spot FILTER args detected before 'add' or 'log' commands, and upgrade them to MODIFICATIONs.
This commit is contained in:
parent
b9b998c769
commit
26f8d8c45d
2 changed files with 28 additions and 0 deletions
27
src/CLI.cpp
27
src/CLI.cpp
|
@ -341,6 +341,7 @@ void CLI::analyze (bool parse /* = true */, bool strict /* = false */)
|
|||
findUUIDs ();
|
||||
insertIDExpr ();
|
||||
desugarTags ();
|
||||
findStrayModifications ();
|
||||
desugarAttributes ();
|
||||
desugarAttributeModifiers ();
|
||||
desugarPatterns ();
|
||||
|
@ -907,6 +908,32 @@ void CLI::desugarTags ()
|
|||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void CLI::findStrayModifications ()
|
||||
{
|
||||
bool changes = false;
|
||||
|
||||
std::string command = getCommand ();
|
||||
if (command == "add" ||
|
||||
command == "log")
|
||||
{
|
||||
std::vector <A>::iterator a;
|
||||
for (a = _args.begin (); a != _args.end (); ++a)
|
||||
{
|
||||
if (a->hasTag ("FILTER"))
|
||||
{
|
||||
a->unTag ("FILTER");
|
||||
a->tag ("MODIFICATION");
|
||||
changes = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (changes)
|
||||
if (context.config.getInteger ("debug.parser") >= 3)
|
||||
context.debug (context.cli.dump ("CLI::analyze findStrayModifications"));
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// <name>:['"][<value>]['"] --> name = value
|
||||
void CLI::desugarAttributes ()
|
||||
|
|
|
@ -93,6 +93,7 @@ private:
|
|||
void categorize ();
|
||||
bool exactMatch (const std::string&, const std::string&) const;
|
||||
void desugarTags ();
|
||||
void findStrayModifications ();
|
||||
void desugarAttributes ();
|
||||
void desugarAttributeModifiers ();
|
||||
void desugarPatterns ();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue