From 983e07ab017f13ce088443f60f57121dec87a123 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sat, 30 Mar 2013 13:06:06 -0400 Subject: [PATCH] Feature - Added some more low-effort, low-risk virutal tags. Why not. - Updated man page. --- ChangeLog | 3 ++- NEWS | 3 ++- doc/man/task.1.in | 5 +++++ src/Task.cpp | 10 ++++++---- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4f1fe83d5..1d2de9e42 100644 --- a/ChangeLog +++ b/ChangeLog @@ -29,7 +29,8 @@ Features + Removed deprecated 'fg:' and 'bg:' attributes. + The 'diagnostics' command now reports libuuid details. + New characters for parsing and formating dates ('n', 's' and 'v'). - + Virtual tags. + + Virtual tags (BLOCKED, UNBLOCKED, BLOCKING, DUE, DUETODAY, TODAY, OVERDUE, + ACTIVE, SCHEDULED, CHILD, UNTIL and WAITING). + New 'modified' attribute, which contains the most recent modification date, if a modification has occurred. + Fixed the mechanism used for selecting translations (thanks to Fidel Mato). diff --git a/NEWS b/NEWS index d9bd54630..63f6c440c 100644 --- a/NEWS +++ b/NEWS @@ -2,7 +2,8 @@ New Features in taskwarrior 2.2.0 - Bash autocompletion now works with aliases. - - Virtual tags provide a tag query interface to more complex states. + - Virtual tags provide a tag query interface to more complex states. See the + 'man task' page for details. - Deprecated 'fg' and 'bg' attributes removed. Any residual use of those will appear as orphaned UDAs. - Tasks now have a 'modified' attribute, which indicates the last time, if at diff --git a/doc/man/task.1.in b/doc/man/task.1.in index 43df7444d..9b6ca7b0f 100644 --- a/doc/man/task.1.in +++ b/doc/man/task.1.in @@ -575,6 +575,11 @@ are: DUETODAY Matches if the task is due today TODAY Matches if the task is due today OVERDUE Matches if the task is overdue + ACTIVE Matches if the task is started + SCHEDULED Matches if the task is scheduled + CHILD Matches if the task has a parent + UNTIL Matches if the task expires + WAITING Matches if the task is waiting You can use +BLOCKED to filter blocked tasks, or -BLOCKED for unblocked tasks. Similarly, -BLOCKED is equivalent to +UNBLOCKED. diff --git a/src/Task.cpp b/src/Task.cpp index d2886174d..1a5c121de 100644 --- a/src/Task.cpp +++ b/src/Task.cpp @@ -955,6 +955,12 @@ bool Task::hasTag (const std::string& tag) const if (tag == "DUETODAY") return is_duetoday (); if (tag == "TODAY") return is_duetoday (); if (tag == "OVERDUE") return is_overdue (); + if (tag == "ACTIVE") return has ("start"); + if (tag == "SCHEDULED") return has ("scheduled"); + if (tag == "CHILD") return has ("parent"); + if (tag == "UNTIL") return has ("until"); + if (tag == "WAITING") return has ("wait"); + /* TODO YESTERDAY - due yesterday TODO TOMORROW - due tomorrow @@ -962,13 +968,9 @@ bool Task::hasTag (const std::string& tag) const TODO MONTH - due this month TODO YEAR - due this year TODO ANNOTATED - has any annotations - TODO ACTIVE - is active TODO READY - is ready - TODO SCHEDULED - is scheduled TODO WAITING - is waiting - TODO CHILD - is a child TODO PARENT - is a parent - TODO UNTIL - will expire */ // Concrete tags.