From f7ab2c4b2d5ae08be0ed9a521ed47aed0f514681 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sat, 29 Apr 2017 11:24:08 -0400 Subject: [PATCH] DOM: New reference tw.version. --- ChangeLog | 3 ++- NEWS | 2 +- doc/man/task.1.in | 1 + src/DOM.cpp | 7 +++++++ src/Lexer.cpp | 1 + 5 files changed, 12 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5d2b2d514..abacb70db 100644 --- a/ChangeLog +++ b/ChangeLog @@ -90,7 +90,8 @@ - Added 'history.weekly', 'history.daily', 'ghistory.weekly', 'ghistory.daily' report variations, with code refactoring. (thanks to Lukas Barth). -- New DOM references: annotations.count, tw.syncneeded. +- New DOM references: annotations.count, tw.syncneeded, tw.program, tw.args, + tw.width, tw.height, tw.version. - The message telling you to sync now indicates how many local changes will be synced. diff --git a/NEWS b/NEWS index 23dac80a2..79b99dbb4 100644 --- a/NEWS +++ b/NEWS @@ -4,7 +4,7 @@ New Features in Taskwarrior 2.6.0 - The 'QUARTER' virtual tag was added. - Improved compatibility with SmartOS, OmniOS and OpenIndiana. - New DOM references: annotations.count, tw.syncneeded, tw.program, tw.args, - tw.width, tw.height. + tw.width, tw.height, tw.version. - Renovated 'timesheet' command with a more compact report that accepts a filter, and has a default filter showing the last four weeks of completed and started tasks. diff --git a/doc/man/task.1.in b/doc/man/task.1.in index fe08403c5..6b6b608b8 100644 --- a/doc/man/task.1.in +++ b/doc/man/task.1.in @@ -638,6 +638,7 @@ from tasks, or the system. Supported DOM references are: tw.args tw.width tw.height + tw.version context.program (Deprecated in 2.6.0) context.args (Deprecated in 2.6.0) context.width (Deprecated in 2.6.0) diff --git a/src/DOM.cpp b/src/DOM.cpp index e85010ac5..996555f49 100644 --- a/src/DOM.cpp +++ b/src/DOM.cpp @@ -53,6 +53,7 @@ extern Context context; // tw.args // tw.width // tw.height +// tw.version // // System: // context.program // 2017-02-25 Deprecated in 2.6.0 @@ -137,6 +138,12 @@ bool getDOM (const std::string& name, Variant& value) return true; } + else if (name == "tw.version") + { + value = Variant (VERSION); + return true; + } + return false; } diff --git a/src/Lexer.cpp b/src/Lexer.cpp index bce96212c..e7dea9071 100644 --- a/src/Lexer.cpp +++ b/src/Lexer.cpp @@ -1190,6 +1190,7 @@ bool Lexer::isDOM (std::string& token, Lexer::Type& type) "tw.args", "tw.width", "tw.height", + "tw.version", "context.program", "context.args", "context.width",