Merge branch 'new_uuid_conflict_tweaks' of pjf/task into 2.6.0

This commit is contained in:
Paul Beckingham
2017-12-08 15:57:04 +00:00
committed by Gitea
2 changed files with 16 additions and 10 deletions

View File

@@ -88,7 +88,7 @@ std::string configurationDefaults =
"\n"
"# Miscellaneous\n"
"# # Comma-separated list. May contain any subset of:\n"
"verbose=blank,header,footnote,label,new-id,new-uuid,affected,edit,special,project,sync,unwait,override,recur\n"
"verbose=blank,header,footnote,label,new-id,affected,edit,special,project,sync,unwait,override,recur\n"
"confirmation=1 # Confirmation on delete, big changes\n"
"recurrence=1 # Enable recurrence\n"
"recurrence.confirmation=prompt # Confirmation for propagating changes among recurring tasks (yes/no/prompt)\n"

View File

@@ -60,7 +60,21 @@ int CmdAdd::execute (std::string& output)
// Do not display ID 0, users cannot query by that
auto status = task.getStatus ();
if (context.verbose ("new-id") &&
// We may have a situation where both new-id and new-uuid config
// variables are set. In that case, we'll show the new-uuid, as
// it's enduring and never changes, and it's unlikely the caller
// asked for this if they just wanted a human-friendly number.
if (context.verbose ("new-uuid") &&
status != Task::recurring)
output += format (STRING_CMD_ADD_FEEDBACK, task.get ("uuid")) + '\n';
else if (context.verbose ("new-uuid") &&
status == Task::recurring)
output += format (STRING_CMD_ADD_RECUR, task.get ("uuid")) + '\n';
else if (context.verbose ("new-id") &&
(status == Task::pending ||
status == Task::waiting))
output += format (STRING_CMD_ADD_FEEDBACK, task.id) + '\n';
@@ -69,14 +83,6 @@ int CmdAdd::execute (std::string& output)
status == Task::recurring)
output += format (STRING_CMD_ADD_RECUR, task.id) + '\n';
else if (context.verbose ("new-uuid") &&
status != Task::recurring)
output += format (STRING_CMD_ADD_FEEDBACK, task.get ("uuid")) + '\n';
else if (context.verbose ("new-uuid") &&
status == Task::recurring)
output += format (STRING_CMD_ADD_RECUR, task.get ("uuid")) + '\n';
if (context.verbose ("project"))
context.footnote (onProjectChange (task));