Added output of number of tasks to be modified in batch mode

This commit is contained in:
Sebastian Uharek 2021-07-18 18:36:01 +02:00 committed by Tomas Babej
parent 178c17d032
commit bd2ad97ccb
9 changed files with 28 additions and 0 deletions

View file

@ -70,6 +70,9 @@ int CmdAnnotate::execute (std::string&)
// Accumulated project change notifications.
std::map <std::string, std::string> projectChanges;
if(filtered.size() > 1) {
std::cout << "This command will alter " << format(filtered.size()) << " tasks." << std::endl;
}
for (auto& task : filtered)
{
Task before (task);

View file

@ -70,6 +70,9 @@ int CmdAppend::execute (std::string&)
// Accumulated project change notifications.
std::map <std::string, std::string> projectChanges;
if(filtered.size() > 1) {
std::cout << "This command will alter " << format(filtered.size()) << " tasks." << std::endl;
}
for (auto& task : filtered)
{
Task before (task);

View file

@ -72,6 +72,9 @@ int CmdDelete::execute (std::string&)
// Accumulated project change notifications.
std::map <std::string, std::string> projectChanges;
if(filtered.size() > 1) {
std::cout << "This command will alter " << format(filtered.size()) << " tasks." << std::endl;
}
for (auto& task : filtered)
{
Task before (task);

View file

@ -87,6 +87,9 @@ int CmdDenotate::execute (std::string&)
// Accumulated project change notifications.
std::map <std::string, std::string> projectChanges;
if(filtered.size() > 1) {
std::cout << "This command will alter " << format(filtered.size()) << " tasks." << std::endl;
}
for (auto& task : filtered)
{
Task before (task);

View file

@ -69,6 +69,10 @@ int CmdDone::execute (std::string&)
std::map <std::string, std::string> 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);

View file

@ -71,6 +71,9 @@ int CmdModify::execute (std::string&)
std::map <std::string, std::string> 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);

View file

@ -70,6 +70,9 @@ int CmdPrepend::execute (std::string&)
// Accumulated project change notifications.
std::map <std::string, std::string> projectChanges;
if(filtered.size() > 1) {
std::cout << "This command will alter " << format(filtered.size()) << " tasks." << std::endl;
}
for (auto& task : filtered)
{
Task before (task);

View file

@ -69,6 +69,9 @@ int CmdStart::execute (std::string&)
std::map <std::string, std::string> 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"))

View file

@ -67,6 +67,9 @@ int CmdStop::execute (std::string&)
// Accumulated project change notifications.
std::map <std::string, std::string> 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"))