mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Cmd{Add,Append,Log,Prepend}
- The commands specify that description changes are required.
This commit is contained in:
parent
b4539a9df9
commit
f3bc606344
4 changed files with 8 additions and 8 deletions
|
@ -51,7 +51,7 @@ int CmdAdd::execute (std::string& output)
|
||||||
|
|
||||||
// Apply the command line modifications to the new task.
|
// Apply the command line modifications to the new task.
|
||||||
Task task;
|
Task task;
|
||||||
task.modify (Task::modReplace);
|
task.modify (Task::modReplace, true);
|
||||||
context.tdb2.add (task);
|
context.tdb2.add (task);
|
||||||
|
|
||||||
if (context.verbose ("new-id"))
|
if (context.verbose ("new-id"))
|
||||||
|
|
|
@ -77,7 +77,7 @@ int CmdAppend::execute (std::string& output)
|
||||||
task->id,
|
task->id,
|
||||||
task->get ("description"));
|
task->get ("description"));
|
||||||
|
|
||||||
task->modify (Task::modAppend);
|
task->modify (Task::modAppend, true);
|
||||||
|
|
||||||
if (permission (*task, taskDifferences (before, *task) + question, filtered.size ()))
|
if (permission (*task, taskDifferences (before, *task) + question, filtered.size ()))
|
||||||
{
|
{
|
||||||
|
@ -97,7 +97,7 @@ int CmdAppend::execute (std::string& output)
|
||||||
std::vector <Task>::iterator sibling;
|
std::vector <Task>::iterator sibling;
|
||||||
for (sibling = siblings.begin (); sibling != siblings.end (); ++sibling)
|
for (sibling = siblings.begin (); sibling != siblings.end (); ++sibling)
|
||||||
{
|
{
|
||||||
sibling->modify (Task::modAppend);
|
sibling->modify (Task::modAppend, true);
|
||||||
context.tdb2.modify (*sibling);
|
context.tdb2.modify (*sibling);
|
||||||
++count;
|
++count;
|
||||||
feedback_affected (STRING_CMD_APPEND_TASK_R, *sibling);
|
feedback_affected (STRING_CMD_APPEND_TASK_R, *sibling);
|
||||||
|
@ -106,7 +106,7 @@ int CmdAppend::execute (std::string& output)
|
||||||
// Append to the parent
|
// Append to the parent
|
||||||
Task parent;
|
Task parent;
|
||||||
context.tdb2.get (task->get ("parent"), parent);
|
context.tdb2.get (task->get ("parent"), parent);
|
||||||
parent.modify (Task::modAppend);
|
parent.modify (Task::modAppend, true);
|
||||||
context.tdb2.modify (parent);
|
context.tdb2.modify (parent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,7 +51,7 @@ int CmdLog::execute (std::string& output)
|
||||||
|
|
||||||
// Apply the command line modifications to the new task.
|
// Apply the command line modifications to the new task.
|
||||||
Task task;
|
Task task;
|
||||||
task.modify (Task::modReplace);
|
task.modify (Task::modReplace, true);
|
||||||
task.setStatus (Task::completed);
|
task.setStatus (Task::completed);
|
||||||
|
|
||||||
// Recurring tasks get a special status.
|
// Recurring tasks get a special status.
|
||||||
|
|
|
@ -77,7 +77,7 @@ int CmdPrepend::execute (std::string& output)
|
||||||
task->id,
|
task->id,
|
||||||
task->get ("description"));
|
task->get ("description"));
|
||||||
|
|
||||||
task->modify (Task::modPrepend);
|
task->modify (Task::modPrepend, true);
|
||||||
|
|
||||||
if (permission (*task, taskDifferences (before, *task) + question, filtered.size ()))
|
if (permission (*task, taskDifferences (before, *task) + question, filtered.size ()))
|
||||||
{
|
{
|
||||||
|
@ -97,7 +97,7 @@ int CmdPrepend::execute (std::string& output)
|
||||||
std::vector <Task>::iterator sibling;
|
std::vector <Task>::iterator sibling;
|
||||||
for (sibling = siblings.begin (); sibling != siblings.end (); ++sibling)
|
for (sibling = siblings.begin (); sibling != siblings.end (); ++sibling)
|
||||||
{
|
{
|
||||||
sibling->modify (Task::modPrepend);
|
sibling->modify (Task::modPrepend, true);
|
||||||
context.tdb2.modify (*sibling);
|
context.tdb2.modify (*sibling);
|
||||||
++count;
|
++count;
|
||||||
feedback_affected (STRING_CMD_PREPEND_TASK_R, *sibling);
|
feedback_affected (STRING_CMD_PREPEND_TASK_R, *sibling);
|
||||||
|
@ -106,7 +106,7 @@ int CmdPrepend::execute (std::string& output)
|
||||||
// Prepend to the parent
|
// Prepend to the parent
|
||||||
Task parent;
|
Task parent;
|
||||||
context.tdb2.get (task->get ("parent"), parent);
|
context.tdb2.get (task->get ("parent"), parent);
|
||||||
parent.modify (Task::modPrepend);
|
parent.modify (Task::modPrepend, true);
|
||||||
context.tdb2.modify (parent);
|
context.tdb2.modify (parent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue