From 7f11f1b560b4a486fa7321ab264d6cf1aa65dede Mon Sep 17 00:00:00 2001 From: Federico Hernandez Date: Tue, 1 Dec 2009 23:00:40 +0100 Subject: [PATCH] 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). --- src/command.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/command.cpp b/src/command.cpp index 964d7d669..c2aede783 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -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 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; }