- Allow ID ranges when editing dependencies.
This commit is contained in:
Louis-Claude Canon 2012-05-05 10:02:57 +02:00 committed by Paul Beckingham
parent 4ee64a52de
commit 38078e9228
2 changed files with 11 additions and 9 deletions

View file

@ -575,18 +575,20 @@ void CmdEdit::parseTask (Task& task, const std::string& after)
std::vector <std::string>::iterator dep;
for (dep = dependencies.begin (); dep != dependencies.end (); ++dep)
{
int id = 0;
std::vector <int> ids;
// Crude UUID check.
// Crude UUID check
if (dep->length () == 36)
id = context.tdb2.pending.id (*dep);
{
int id = context.tdb2.pending.id (*dep);
ids.push_back (id);
}
else
id = atoi (dep->c_str ());
A3::extract_id (*dep, ids);
if (id)
task.addDependency (id);
else
task.addDependency (*dep);
std::vector <int>::iterator id;
for (id = ids.begin (); id != ids.end(); id++)
task.addDependency (*id);
}
}

View file

@ -599,7 +599,7 @@
#define STRING_EDIT_UNPARSEABLE "Taskwarrior couldn't handle your edits. Would you like to try again?"
#define STRING_EDIT_UNWRITABLE "Your data.location directory is not writable."
#define STRING_EDIT_TAG_SEP "Separate the tags with spaces, like this: tag1 tag2"
#define STRING_EDIT_DEP_SEP "Dependencies should be a comma-separated list of task IDs/UUIDs, with no spaces."
#define STRING_EDIT_DEP_SEP "Dependencies should be a comma-separated list of task IDs/UUIDs or ID ranges, with no spaces."
#define STRING_EDIT_END "End"
#define STRING_EDIT_PROJECT_MOD "Project modified."