- Added error checking for "recur" without "due"
- Added error checking for "until" without "recur" - Added status setting for "task add" regarding T::recurring
This commit is contained in:
@@ -381,10 +381,8 @@ void parse (
|
||||
std::string value = arg.substr (colon + 1, std::string::npos);
|
||||
|
||||
if (validAttribute (name, value, conf))
|
||||
{
|
||||
if (name != "recur" || validDuration (value))
|
||||
task.setAttribute (name, value);
|
||||
}
|
||||
}
|
||||
|
||||
// Substitution of description text.
|
||||
@@ -408,6 +406,14 @@ void parse (
|
||||
}
|
||||
}
|
||||
|
||||
if (task.getAttribute ("recur") != "" &&
|
||||
task.getAttribute ("due") == "")
|
||||
throw std::string ("You cannot specify a recurring task without a due date.");
|
||||
|
||||
if (task.getAttribute ("until") != "" &&
|
||||
task.getAttribute ("recur") == "")
|
||||
throw std::string ("You cannot specify an until date for a non-recurring task.");
|
||||
|
||||
if (validDescription (descCandidate))
|
||||
task.setDescription (descCandidate);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user