mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-29 17:07:19 +02:00
CLI
- Allow ::getWords to run ::analyze but skip the desugar and decomposition steps.
This commit is contained in:
parent
0ca4b34f75
commit
0138c13833
2 changed files with 24 additions and 18 deletions
40
src/CLI.cpp
40
src/CLI.cpp
|
@ -271,7 +271,7 @@ void CLI::add (const std::string& arg)
|
|||
// Intended to be called after ::initialize() and ::add(), to perform the final
|
||||
// analysis. Analysis is also performed directly after the above, because there
|
||||
// is a need to extract overrides early, before entities are proviedd.
|
||||
void CLI::analyze ()
|
||||
void CLI::analyze (bool parse /* = true */)
|
||||
{
|
||||
// Clean what needs to be cleaned. Most in this case.
|
||||
_args.clear ();
|
||||
|
@ -311,22 +311,25 @@ void CLI::analyze ()
|
|||
findOverrides ();
|
||||
categorize ();
|
||||
|
||||
// Remove all the syntactic sugar for FILTERs.
|
||||
desugarTags ();
|
||||
desugarAttributes ();
|
||||
desugarAttributeModifiers ();
|
||||
desugarPatterns ();
|
||||
desugarIDs ();
|
||||
desugarUUIDs ();
|
||||
//desugarPlainArgs ();
|
||||
findOperators ();
|
||||
insertJunctions ();
|
||||
if (parse)
|
||||
{
|
||||
// Remove all the syntactic sugar for FILTERs.
|
||||
desugarTags ();
|
||||
desugarAttributes ();
|
||||
desugarAttributeModifiers ();
|
||||
desugarPatterns ();
|
||||
desugarIDs ();
|
||||
desugarUUIDs ();
|
||||
findOperators ();
|
||||
insertJunctions ();
|
||||
desugarPlainArgs ();
|
||||
|
||||
// Decompose the elements for MODIFICATIONs.
|
||||
decomposeModAttributes ();
|
||||
decomposeModAttributeModifiers ();
|
||||
decomposeModTags ();
|
||||
decomposeModSubstitutions ();
|
||||
// Decompose the elements for MODIFICATIONs.
|
||||
decomposeModAttributes ();
|
||||
decomposeModAttributeModifiers ();
|
||||
decomposeModTags ();
|
||||
decomposeModSubstitutions ();
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -361,8 +364,11 @@ const std::string CLI::getFilter ()
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
const std::vector <std::string> CLI::getWords ()
|
||||
{
|
||||
std::vector <std::string> words;
|
||||
// Re-analyze the arguments, but do not de-sugar or decompose any. Analysis
|
||||
// only.
|
||||
analyze (false);
|
||||
|
||||
std::vector <std::string> words;
|
||||
std::vector <A>::const_iterator a;
|
||||
for (a = _args.begin (); a != _args.end (); ++a)
|
||||
{
|
||||
|
|
|
@ -69,7 +69,7 @@ public:
|
|||
void entity (const std::string&, const std::string&);
|
||||
void initialize (int, const char**);
|
||||
void add (const std::string&);
|
||||
void analyze ();
|
||||
void analyze (bool parse = true);
|
||||
const std::string getFilter ();
|
||||
const std::vector <std::string> getWords ();
|
||||
const std::vector <std::string> getModifications ();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue