Bug Fix - #333 duplicate command should display the ID of the created task

- Added missing "Created task" output to duplicate command (thanks to
  Cory Donnelly).
This commit is contained in:
Federico Hernandez 2009-12-01 23:00:40 +01:00
parent b246fae889
commit 7f11f1b560

View file

@ -1140,12 +1140,21 @@ int handleDuplicate (std::string &outs)
++count;
}
if (context.config.get ("echo.command", true))
{
out << "Duplicated " << count << " task" << (count == 1 ? "" : "s") << std::endl;
#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 ();
if (context.config.get ("echo.command", true))
out << "Duplicated " << count << " task" << (count == 1 ? "" : "s") << std::endl;
outs = out.str ();
return 0;
}