mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-28 13:37:20 +02:00
Enhancement - echo ID on add
- When a task is added, the new ID is echoed back, for convenience. This requires a scan of the pending file, so there is a performance hit, and the feature is controlled by the FEATURE_NEW_ID define.
This commit is contained in:
parent
02518e0223
commit
f5e0f8b7a6
4 changed files with 17 additions and 9 deletions
|
@ -83,6 +83,15 @@ std::string handleAdd ()
|
|||
|
||||
context.tdb.lock (context.config.get ("locking", true));
|
||||
context.tdb.add (context.task);
|
||||
|
||||
#ifdef FEATURE_NEW_ID
|
||||
// All this, just for an id number.
|
||||
std::vector <Task> all;
|
||||
Filter none;
|
||||
context.tdb.loadPending (all, none);
|
||||
out << "Created task " << context.tdb.nextId () << std::endl;
|
||||
#endif
|
||||
|
||||
context.tdb.commit ();
|
||||
context.tdb.unlock ();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue