mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-30 02:17:21 +02:00
Feature - #283 verbosity of annotations
- the configuration variable annotation.details now controls the verbosity of the output of annotations.
This commit is contained in:
parent
b001c2f40b
commit
3aae7b180b
6 changed files with 97 additions and 21 deletions
|
@ -2113,12 +2113,32 @@ std::string getFullDescription (Task& task)
|
|||
|
||||
std::vector <Att> annotations;
|
||||
task.getAnnotations (annotations);
|
||||
foreach (anno, annotations)
|
||||
{
|
||||
Date dt (atoi (anno->name ().substr (11).c_str ()));
|
||||
std::string when = dt.toString (context.config.get ("dateformat", "m/d/Y"));
|
||||
desc += "\n" + when + " " + anno->value ();
|
||||
}
|
||||
|
||||
if (annotations.size () != 0)
|
||||
switch (context.config.get("annotation.details",2))
|
||||
{
|
||||
case 0:
|
||||
desc = "+" + desc;
|
||||
break;
|
||||
case 1:
|
||||
{
|
||||
if (annotations.size () > 1)
|
||||
desc = "+" + desc;
|
||||
Att anno (annotations.back());
|
||||
Date dt (atoi (anno.name ().substr (11).c_str ()));
|
||||
std::string when = dt.toString (context.config.get ("dateformat", "m/d/Y"));
|
||||
desc += "\n" + when + " " + anno.value ();
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
foreach (anno, annotations)
|
||||
{
|
||||
Date dt (atoi (anno->name ().substr (11).c_str ()));
|
||||
std::string when = dt.toString (context.config.get ("dateformat", "m/d/Y"));
|
||||
desc += "\n" + when + " " + anno->value ();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return desc;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue