mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Merge branch '2.3.0' of tasktools.org:task into 2.3.0
This commit is contained in:
commit
70f4f9dbb2
11 changed files with 38 additions and 28 deletions
|
@ -37,6 +37,7 @@ Features
|
|||
+ Now requires libuuid (thanks to Martin Natano).
|
||||
+ New '_get' is a DOM accessor helper command.
|
||||
+ New virtual tags (WEEK, MONTH, YEAR, PARENT).
|
||||
+ Added the 'remaining' format for all date columns.
|
||||
|
||||
Bugs
|
||||
+ #1196 Now builds on Hurd (thanks to Jakub Wilk).
|
||||
|
|
1
NEWS
1
NEWS
|
@ -9,6 +9,7 @@ New Features in taskwarrior 2.3.0
|
|||
- Now requires libuuid.
|
||||
- New '_get' DOM accessor helper command.
|
||||
- New virtual tags: WEEK, MONTH, YEAR, PARENT.
|
||||
- New 'remaining' format for date columns.
|
||||
|
||||
New commands in taskwarrior 2.3.0
|
||||
|
||||
|
|
|
@ -1204,11 +1204,8 @@ The description for report X when running the "task help" command.
|
|||
|
||||
.TP
|
||||
.B report.X.columns
|
||||
The columns that will be used when generating the report X. Valid columns are:
|
||||
id, uuid, status, project, priority, priority_long, entry, start, end, due,
|
||||
countdown, countdown_compact, age, age_compact, active, tags, depends,
|
||||
description_only, description, recur, recurrence_indicator, tag_indicator and
|
||||
wait. The IDs are separated by commas.
|
||||
This is a comma-separated list of columns and formatting specifiers. See the
|
||||
command 'task columns' for a full list of options and examples.
|
||||
|
||||
.TP
|
||||
.B report.X.labels
|
||||
|
@ -1222,7 +1219,7 @@ specified by using the column ids post-fixed by a "+" for ascending sort order
|
|||
or a "-" for descending sort order. The sort IDs are separated by commas.
|
||||
For example:
|
||||
|
||||
report.list.sort=due+,priority-,active-,project+
|
||||
report.list.sort=due+,priority-,start.active-,project+
|
||||
|
||||
.TP
|
||||
.B report.X.filter
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <cmake.h>
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
#include <Context.h>
|
||||
#include <ColDate.h>
|
||||
|
@ -50,6 +49,8 @@ ColumnDate::ColumnDate ()
|
|||
_styles.push_back ("epoch");
|
||||
_styles.push_back ("iso");
|
||||
_styles.push_back ("age");
|
||||
_styles.push_back ("remaining");
|
||||
_styles.push_back ("countdown");
|
||||
|
||||
Date now;
|
||||
now -= 125; // So that "age" is non-zero.
|
||||
|
@ -58,6 +59,8 @@ ColumnDate::ColumnDate ()
|
|||
_examples.push_back (now.toEpochString ());
|
||||
_examples.push_back (now.toISO ());
|
||||
_examples.push_back (Duration (Date () - now).formatCompact ());
|
||||
_examples.push_back ("");
|
||||
_examples.push_back (Duration (Date () - now).format ());
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -79,7 +82,7 @@ void ColumnDate::measure (Task& task, unsigned int& minimum, unsigned int& maxim
|
|||
|
||||
if (task.has (_name))
|
||||
{
|
||||
Date date ((time_t) strtol (task.get (_name).c_str (), NULL, 10));
|
||||
Date date (task.get_date (_name));
|
||||
|
||||
if (_style == "default" ||
|
||||
_style == "formatted")
|
||||
|
@ -98,7 +101,6 @@ void ColumnDate::measure (Task& task, unsigned int& minimum, unsigned int& maxim
|
|||
}
|
||||
else if (_style == "countdown")
|
||||
{
|
||||
Date date ((time_t) strtol (task.get (_name).c_str (), NULL, 10));
|
||||
Date now;
|
||||
minimum = maximum = Duration (now - date).format ().length ();
|
||||
}
|
||||
|
@ -119,6 +121,12 @@ void ColumnDate::measure (Task& task, unsigned int& minimum, unsigned int& maxim
|
|||
Date now;
|
||||
minimum = maximum = Duration (now - date).formatCompact ().length ();
|
||||
}
|
||||
else if (_style == "remaining")
|
||||
{
|
||||
Date now;
|
||||
if (date > now)
|
||||
minimum = maximum = Duration (date - now).format ().length ();
|
||||
}
|
||||
else
|
||||
throw format (STRING_COLUMN_BAD_FORMAT, _name, _style);
|
||||
}
|
||||
|
@ -133,6 +141,8 @@ void ColumnDate::render (
|
|||
{
|
||||
if (task.has (_name))
|
||||
{
|
||||
Date date (task.get_date (_name));
|
||||
|
||||
if (_style == "default" ||
|
||||
_style == "formatted")
|
||||
{
|
||||
|
@ -149,12 +159,10 @@ void ColumnDate::render (
|
|||
lines.push_back (
|
||||
color.colorize (
|
||||
leftJustify (
|
||||
Date ((time_t) strtol (task.get (_name).c_str (), NULL, 10))
|
||||
.toString (format), width)));
|
||||
date.toString (format), width)));
|
||||
}
|
||||
else if (_style == "countdown")
|
||||
{
|
||||
Date date ((time_t) strtol (task.get (_name).c_str (), NULL, 10));
|
||||
Date now;
|
||||
|
||||
lines.push_back (
|
||||
|
@ -167,28 +175,24 @@ void ColumnDate::render (
|
|||
lines.push_back (
|
||||
color.colorize (
|
||||
rightJustify (
|
||||
format (Date ((time_t) strtol (task.get (_name).c_str (), NULL, 10))
|
||||
.toJulian (), 13, 12), width)));
|
||||
format (date.toJulian (), 13, 12), width)));
|
||||
}
|
||||
else if (_style == "epoch")
|
||||
{
|
||||
lines.push_back (
|
||||
color.colorize (
|
||||
rightJustify (
|
||||
Date ((time_t) strtol (task.get (_name).c_str (), NULL, 10))
|
||||
.toEpochString (), width)));
|
||||
date.toEpochString (), width)));
|
||||
}
|
||||
else if (_style == "iso")
|
||||
{
|
||||
lines.push_back (
|
||||
color.colorize (
|
||||
leftJustify (
|
||||
Date ((time_t) strtol (task.get (_name).c_str (), NULL, 10))
|
||||
.toISO (), width)));
|
||||
date.toISO (), width)));
|
||||
}
|
||||
else if (_style == "age")
|
||||
{
|
||||
Date date ((time_t) strtol (task.get (_name).c_str (), NULL, 10));
|
||||
Date now;
|
||||
|
||||
lines.push_back (
|
||||
|
@ -196,6 +200,17 @@ void ColumnDate::render (
|
|||
leftJustify (
|
||||
Duration (now - date).formatCompact (), width)));
|
||||
}
|
||||
else if (_style == "remaining")
|
||||
{
|
||||
Date now;
|
||||
if (date > now)
|
||||
lines.push_back (
|
||||
color.colorize (
|
||||
rightJustify (
|
||||
Duration (date - now).format (), width)));
|
||||
else
|
||||
lines.push_back ("");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -42,8 +42,6 @@ ColumnDue::ColumnDue ()
|
|||
_name = "due";
|
||||
_label = STRING_COLUMN_LABEL_DUE;
|
||||
|
||||
_styles.push_back ("countdown");
|
||||
|
||||
Date now;
|
||||
now += 125;
|
||||
_examples.push_back (Duration (now - Date ()).formatCompact ());
|
||||
|
|
|
@ -41,12 +41,6 @@ ColumnScheduled::ColumnScheduled ()
|
|||
{
|
||||
_name = "scheduled";
|
||||
_label = STRING_COLUMN_LABEL_SCHED;
|
||||
|
||||
_styles.push_back ("countdown");
|
||||
|
||||
Date now;
|
||||
now += 125;
|
||||
_examples.push_back (Duration (now - Date ()).formatCompact ());
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -51,7 +51,7 @@ int CmdGet::execute (std::string& output)
|
|||
// have already been handled.
|
||||
std::vector <std::string> words = context.a3.extract_words ();
|
||||
if (words.size () == 0)
|
||||
throw std::string ("Need args!");
|
||||
throw std::string (STRING_CMD_GET_NO_DOM);
|
||||
|
||||
std::vector <std::string> results;
|
||||
std::vector <std::string>::iterator word;
|
||||
|
|
|
@ -308,6 +308,7 @@
|
|||
#define STRING_CMD_SUMMARY_NONE "(none)"
|
||||
#define STRING_CMD_COUNT_USAGE "Counts matching tasks"
|
||||
#define STRING_CMD_GET_USAGE "DOM Accessor"
|
||||
#define STRING_CMD_GET_NO_DOM "No DOM reference specified."
|
||||
|
||||
#define STRING_CMD_UDAS_NO "No UDAs defined."
|
||||
#define STRING_CMD_UDAS_SUMMARY "{1} UDA defined"
|
||||
|
|
|
@ -317,6 +317,7 @@
|
|||
#define STRING_CMD_SUMMARY_NONE "(ninguna)"
|
||||
#define STRING_CMD_COUNT_USAGE "Cuenta tareas que coinciden"
|
||||
#define STRING_CMD_GET_USAGE "DOM Accessor"
|
||||
#define STRING_CMD_GET_NO_DOM "No DOM reference specified."
|
||||
|
||||
#define STRING_CMD_UDAS_NO "Ningún UDA definido."
|
||||
#define STRING_CMD_UDAS_SUMMARY "{1} UDA definido"
|
||||
|
|
|
@ -308,6 +308,7 @@
|
|||
#define STRING_CMD_SUMMARY_NONE "(none)"
|
||||
#define STRING_CMD_COUNT_USAGE "Counts matching tasks"
|
||||
#define STRING_CMD_GET_USAGE "DOM Accessor"
|
||||
#define STRING_CMD_GET_NO_DOM "No DOM reference specified."
|
||||
|
||||
#define STRING_CMD_UDAS_NO "No UDAs defined."
|
||||
#define STRING_CMD_UDAS_SUMMARY "{1} UDA defined"
|
||||
|
|
|
@ -309,6 +309,7 @@
|
|||
#define STRING_CMD_SUMMARY_NONE "(nessuno)"
|
||||
#define STRING_CMD_COUNT_USAGE "Conteggia task corrispondenti"
|
||||
#define STRING_CMD_GET_USAGE "DOM Accessor"
|
||||
#define STRING_CMD_GET_NO_DOM "No DOM reference specified."
|
||||
|
||||
#define STRING_CMD_UDAS_NO "Nessun UDA definito."
|
||||
#define STRING_CMD_UDAS_SUMMARY "{1} UDA definito"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue