From 6bfb275dcc6133be2e6947e20621e82ccc0c0488 Mon Sep 17 00:00:00 2001 From: Tomas Babej Date: Fri, 18 Sep 2020 00:24:47 -0400 Subject: [PATCH] CmdAdd: Make sure a UUID is printed if ID does not exist This fixes a regression was introduced in 4e80d5d5fdb317f746a902ba83c891d7b20fe44f. Currently, if a user (with default configuration) adds a completed or deleted task, they do not get a confirmation message ("Created task ..."). This is due to the fact that: a) new-uuid is not set by default b) new-id is set by default, but only prints message if the added task is in pending or waiting state Make sure to print a message containing UUID reference if the newly added task is in completed or deleted state. --- src/commands/CmdAdd.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/commands/CmdAdd.cpp b/src/commands/CmdAdd.cpp index de9eef8ac..e76d68ac2 100644 --- a/src/commands/CmdAdd.cpp +++ b/src/commands/CmdAdd.cpp @@ -63,13 +63,15 @@ int CmdAdd::execute (std::string& output) // asked for this if they just wanted a human-friendly number. if (Context::getContext ().verbose ("new-uuid") && - status != Task::recurring) - output += format ("Created task {1}.\n", task.get ("uuid")); - - else if (Context::getContext ().verbose ("new-uuid") && status == Task::recurring) output += format ("Created task {1} (recurrence template).\n", task.get ("uuid")); + else if (Context::getContext ().verbose ("new-uuid") || + (Context::getContext ().verbose ("new-id") && + (status == Task::completed || + status == Task::deleted))) + output += format ("Created task {1}.\n", task.get ("uuid")); + else if (Context::getContext ().verbose ("new-id") && (status == Task::pending || status == Task::waiting))