From bd2ad97ccbbac4fe02f6ee6312c60eff431b98d9 Mon Sep 17 00:00:00 2001 From: Sebastian Uharek Date: Sun, 18 Jul 2021 18:36:01 +0200 Subject: [PATCH] Added output of number of tasks to be modified in batch mode --- src/commands/CmdAnnotate.cpp | 3 +++ src/commands/CmdAppend.cpp | 3 +++ src/commands/CmdDelete.cpp | 3 +++ src/commands/CmdDenotate.cpp | 3 +++ src/commands/CmdDone.cpp | 4 ++++ src/commands/CmdModify.cpp | 3 +++ src/commands/CmdPrepend.cpp | 3 +++ src/commands/CmdStart.cpp | 3 +++ src/commands/CmdStop.cpp | 3 +++ 9 files changed, 28 insertions(+) diff --git a/src/commands/CmdAnnotate.cpp b/src/commands/CmdAnnotate.cpp index 400f370e0..d91ff71d8 100644 --- a/src/commands/CmdAnnotate.cpp +++ b/src/commands/CmdAnnotate.cpp @@ -70,6 +70,9 @@ int CmdAnnotate::execute (std::string&) // Accumulated project change notifications. std::map projectChanges; + if(filtered.size() > 1) { + std::cout << "This command will alter " << format(filtered.size()) << " tasks." << std::endl; + } for (auto& task : filtered) { Task before (task); diff --git a/src/commands/CmdAppend.cpp b/src/commands/CmdAppend.cpp index 33f2f7d72..ee811cd03 100644 --- a/src/commands/CmdAppend.cpp +++ b/src/commands/CmdAppend.cpp @@ -70,6 +70,9 @@ int CmdAppend::execute (std::string&) // Accumulated project change notifications. std::map projectChanges; + if(filtered.size() > 1) { + std::cout << "This command will alter " << format(filtered.size()) << " tasks." << std::endl; + } for (auto& task : filtered) { Task before (task); diff --git a/src/commands/CmdDelete.cpp b/src/commands/CmdDelete.cpp index ac2e2aefd..465387305 100644 --- a/src/commands/CmdDelete.cpp +++ b/src/commands/CmdDelete.cpp @@ -72,6 +72,9 @@ int CmdDelete::execute (std::string&) // Accumulated project change notifications. std::map projectChanges; + if(filtered.size() > 1) { + std::cout << "This command will alter " << format(filtered.size()) << " tasks." << std::endl; + } for (auto& task : filtered) { Task before (task); diff --git a/src/commands/CmdDenotate.cpp b/src/commands/CmdDenotate.cpp index d6e187999..4bd1e2634 100644 --- a/src/commands/CmdDenotate.cpp +++ b/src/commands/CmdDenotate.cpp @@ -87,6 +87,9 @@ int CmdDenotate::execute (std::string&) // Accumulated project change notifications. std::map projectChanges; + if(filtered.size() > 1) { + std::cout << "This command will alter " << format(filtered.size()) << " tasks." << std::endl; + } for (auto& task : filtered) { Task before (task); diff --git a/src/commands/CmdDone.cpp b/src/commands/CmdDone.cpp index 4a853ecfa..63ebb8e81 100644 --- a/src/commands/CmdDone.cpp +++ b/src/commands/CmdDone.cpp @@ -69,6 +69,10 @@ int CmdDone::execute (std::string&) std::map projectChanges; Task& lowest = filtered.front(); + + if(filtered.size() > 1) { + std::cout << "This command will alter " << format(filtered.size()) << " tasks." << std::endl; + } for (auto& task : filtered) { Task before (task); diff --git a/src/commands/CmdModify.cpp b/src/commands/CmdModify.cpp index a5f079229..6809de9eb 100644 --- a/src/commands/CmdModify.cpp +++ b/src/commands/CmdModify.cpp @@ -71,6 +71,9 @@ int CmdModify::execute (std::string&) std::map projectChanges; auto count = 0; + if(filtered.size() > 1) { + std::cout << "This command will alter " << format(filtered.size()) << " tasks." << std::endl; + } for (auto& task : filtered) { Task before (task); diff --git a/src/commands/CmdPrepend.cpp b/src/commands/CmdPrepend.cpp index 750ab4be5..0f063a53e 100644 --- a/src/commands/CmdPrepend.cpp +++ b/src/commands/CmdPrepend.cpp @@ -70,6 +70,9 @@ int CmdPrepend::execute (std::string&) // Accumulated project change notifications. std::map projectChanges; + if(filtered.size() > 1) { + std::cout << "This command will alter " << format(filtered.size()) << " tasks." << std::endl; + } for (auto& task : filtered) { Task before (task); diff --git a/src/commands/CmdStart.cpp b/src/commands/CmdStart.cpp index 22a765be2..c7ef8ac43 100644 --- a/src/commands/CmdStart.cpp +++ b/src/commands/CmdStart.cpp @@ -69,6 +69,9 @@ int CmdStart::execute (std::string&) std::map projectChanges; bool nagged = false; + if(filtered.size() > 1) { + std::cout << "This command will alter " << format(filtered.size()) << " tasks." << std::endl; + } for (auto& task : filtered) { if (! task.has ("start")) diff --git a/src/commands/CmdStop.cpp b/src/commands/CmdStop.cpp index 645a4121d..17acd6774 100644 --- a/src/commands/CmdStop.cpp +++ b/src/commands/CmdStop.cpp @@ -67,6 +67,9 @@ int CmdStop::execute (std::string&) // Accumulated project change notifications. std::map projectChanges; + if(filtered.size() > 1) { + std::cout << "This command will alter " << format(filtered.size()) << " tasks." << std::endl; + } for (auto& task : filtered) { if (task.has ("start"))