mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Feature #412
- Allows the 'projects' and 'tags' commands to be list all used projects/tags, not just the ones used in current pending tasks. Controlled by the 'list.all.projects' and 'list.all.tags' configuration variables (thanks to Dirk Deimeke). - Added unit tests. - Updated man pages.
This commit is contained in:
parent
8572080677
commit
2c7552222a
6 changed files with 171 additions and 8 deletions
|
@ -187,11 +187,15 @@ int handleProjects (std::string &outs)
|
|||
if (context.hooks.trigger ("pre-projects-command"))
|
||||
{
|
||||
std::stringstream out;
|
||||
context.filter.push_back (Att ("status", "pending"));
|
||||
|
||||
std::vector <Task> tasks;
|
||||
context.tdb.lock (context.config.getBoolean ("locking"));
|
||||
int quantity = context.tdb.loadPending (tasks, context.filter);
|
||||
int quantity;
|
||||
if (context.config.getBoolean ("list.all.projects"))
|
||||
quantity = context.tdb.load (tasks, context.filter);
|
||||
else
|
||||
quantity = context.tdb.loadPending (tasks, context.filter);
|
||||
|
||||
context.tdb.commit ();
|
||||
context.tdb.unlock ();
|
||||
|
||||
|
@ -318,11 +322,14 @@ int handleTags (std::string &outs)
|
|||
{
|
||||
std::stringstream out;
|
||||
|
||||
context.filter.push_back (Att ("status", "pending"));
|
||||
|
||||
std::vector <Task> tasks;
|
||||
context.tdb.lock (context.config.getBoolean ("locking"));
|
||||
int quantity = context.tdb.loadPending (tasks, context.filter);
|
||||
int quantity = 0;
|
||||
if (context.config.getBoolean ("list.all.tags"))
|
||||
quantity += context.tdb.load (tasks, context.filter);
|
||||
else
|
||||
quantity += context.tdb.loadPending (tasks, context.filter);
|
||||
|
||||
context.tdb.commit ();
|
||||
context.tdb.unlock ();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue