Documentation - special tags

- Special tags are now documented in task.1.
- The 'tags' command now highlights special tags.
This commit is contained in:
Paul Beckingham 2010-07-22 16:00:29 -07:00
parent 9a973770d8
commit a345541ff7
4 changed files with 23 additions and 5 deletions

View file

@ -15,6 +15,7 @@
+ Improved man pages (thanks to Andy Lester). + Improved man pages (thanks to Andy Lester).
+ Default .taskrc files are now largely empty, and rely almost completed + Default .taskrc files are now largely empty, and rely almost completed
on default values. on default values.
+ Special tags are now documented, and the 'tags' command highlights them.
+ Fixed bug #427, preventing the task edit command to parse annotation + Fixed bug #427, preventing the task edit command to parse annotation
dates with spaces. dates with spaces.
+ Fixed bug #433, making task command output more consistent. + Fixed bug #433, making task command output more consistent.

2
NEWS
View file

@ -2,7 +2,7 @@
New Features in task 1.9.3 New Features in task 1.9.3
- Start and stop times for a task can now be recorded as annotations. - Start and stop times for a task can now be recorded as annotations.
- - Special tags 'nocolor' and 'nonag'.
Please refer to the ChangeLog file for full details. There are too many to Please refer to the ChangeLog file for full details. There are too many to
list here. list here.

View file

@ -84,7 +84,7 @@ number of tasks for each.
.TP .TP
.B tags .B tags
Show a list of all tags used. Show a list of all tags used. Any special tags used are highlighted.
.TP .TP
.B summary .B summary
@ -269,7 +269,14 @@ task del 1,4-10,19
.TP .TP
.B +tag|-tag .B +tag|-tag
Tags are arbitrary words associated with a task. Use + to add a tag and - to Tags are arbitrary words associated with a task. Use + to add a tag and - to
remove a tag from a task. A task can have any quantity of tags remove a tag from a task. A task can have any quantity of tags.
Certain tags (called 'special tags'), can be used to affect the way tasks are
treated. For example, is a task has the special tag 'nocolor', then it is
exempt from all color rules. The supported special tags are:
+nocolor Disable color rules processing for this task.
+nonag Completion of this task suppresses all nag messages.
.TP .TP
.B project:<project-name> .B project:<project-name>

View file

@ -378,6 +378,9 @@ int handleTags (std::string &outs)
unique[*tag] = 1; unique[*tag] = 1;
} }
bool use_color = context.config.getBoolean ("color") ||
context.config.getBoolean ("_forcecolor");
if (unique.size ()) if (unique.size ())
{ {
// Render a list of tags names from the map. // Render a list of tags names from the map.
@ -385,8 +388,7 @@ int handleTags (std::string &outs)
table.addColumn ("Tag"); table.addColumn ("Tag");
table.addColumn ("Count"); table.addColumn ("Count");
if (context.config.getBoolean ("color") || if (use_color)
context.config.getBoolean ("_forcecolor"))
{ {
table.setColumnUnderline (0); table.setColumnUnderline (0);
table.setColumnUnderline (1); table.setColumnUnderline (1);
@ -394,11 +396,19 @@ int handleTags (std::string &outs)
table.setColumnJustification (1, Table::right); table.setColumnJustification (1, Table::right);
Color bold ("bold");
foreach (i, unique) foreach (i, unique)
{ {
int row = table.addRow (); int row = table.addRow ();
table.addCell (row, 0, i->first); table.addCell (row, 0, i->first);
table.addCell (row, 1, i->second); table.addCell (row, 1, i->second);
// Highlight the special tags.
if (use_color && (i->first == "nocolor" ||
i->first == "nonag"))
{
table.setRowColor (row, bold);
}
} }
out << optionalBlankLine () out << optionalBlankLine ()