mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-19 19:03:07 +02:00
CmdEdit: Respect bulk option
Since 'task edit' is a data-modification operation (that is particularly hard to cancel mid-way), it should also respect the 'bulk' option like all the other modification operations (mod, start...). Closes #2428.
This commit is contained in:
parent
d95b64c5a0
commit
693f2f74cd
1 changed files with 8 additions and 0 deletions
|
@ -88,6 +88,14 @@ int CmdEdit::execute (std::string&)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsigned int bulk = Context::getContext ().config.getInteger ("bulk");
|
||||||
|
|
||||||
|
// If we are editing more than "bulk" tasks, ask for confirmation.
|
||||||
|
// Bulk = 0 denotes infinite bulk.
|
||||||
|
if ((filtered.size () > bulk) && (bulk != 0))
|
||||||
|
if (! confirm (format ("Do you wish to manually edit {1} tasks?", filtered.size ())))
|
||||||
|
return 2;
|
||||||
|
|
||||||
// Find number of matching tasks.
|
// Find number of matching tasks.
|
||||||
for (auto& task : filtered)
|
for (auto& task : filtered)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue