mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-28 13:37:20 +02:00
Enhancement
- Added new _ids command to support tab completion scripts.
This commit is contained in:
parent
02c7d7607c
commit
ca4bae558d
4 changed files with 30 additions and 0 deletions
|
@ -330,6 +330,32 @@ std::string handleCompletionCommands ()
|
|||
return out.str ();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
std::string handleCompletionIDs ()
|
||||
{
|
||||
std::vector <Task> tasks;
|
||||
context.tdb.lock (context.config.get ("locking", true));
|
||||
handleRecurrence ();
|
||||
Filter filter;
|
||||
context.tdb.loadPending (tasks, filter);
|
||||
context.tdb.commit ();
|
||||
context.tdb.unlock ();
|
||||
|
||||
std::vector <int> ids;
|
||||
foreach (task, tasks)
|
||||
if (task->getStatus () != Task::deleted &&
|
||||
task->getStatus () != Task::completed)
|
||||
ids.push_back (task->id);
|
||||
|
||||
std::sort (ids.begin (), ids.end ());
|
||||
|
||||
std::stringstream out;
|
||||
foreach (id, ids)
|
||||
out << *id << std::endl;
|
||||
|
||||
return out.str ();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void handleUndo ()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue