- Added builtin command detection
- Now allows override of due/overdue coloration
This commit is contained in:
@@ -348,6 +348,18 @@ static bool validCommand (std::string& input)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
static bool validBuiltinCommand (std::string& input)
|
||||||
|
{
|
||||||
|
std::string copy = input;
|
||||||
|
guess ("command", commands, copy);
|
||||||
|
if (copy == "")
|
||||||
|
return false;
|
||||||
|
|
||||||
|
input = copy;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
static bool validSubstitution (
|
static bool validSubstitution (
|
||||||
std::string& input,
|
std::string& input,
|
||||||
|
|||||||
@@ -265,9 +265,9 @@ std::string handleList (TDB& tdb, T& task, Config& conf)
|
|||||||
if (fg == Text::nocolor)
|
if (fg == Text::nocolor)
|
||||||
{
|
{
|
||||||
if (overdue)
|
if (overdue)
|
||||||
table.setCellFg (row, 3, Text::red);
|
table.setCellFg (row, 3, Text::colorCode (conf.get ("color.overdue", "red")));
|
||||||
else if (imminent)
|
else if (imminent)
|
||||||
table.setCellFg (row, 3, Text::yellow);
|
table.setCellFg (row, 3, Text::colorCode (conf.get ("color.due", "yellow")));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -397,9 +397,9 @@ std::string handleSmallList (TDB& tdb, T& task, Config& conf)
|
|||||||
if (fg == Text::nocolor)
|
if (fg == Text::nocolor)
|
||||||
{
|
{
|
||||||
if (overdue)
|
if (overdue)
|
||||||
table.setCellFg (row, 3, Text::red);
|
table.setCellFg (row, 3, Text::colorCode (conf.get ("color.overdue", "red")));
|
||||||
else if (imminent)
|
else if (imminent)
|
||||||
table.setCellFg (row, 3, Text::yellow);
|
table.setCellFg (row, 3, Text::colorCode (conf.get ("color.due", "yellow")));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -638,9 +638,9 @@ std::string handleInfo (TDB& tdb, T& task, Config& conf)
|
|||||||
if (conf.get ("color", true))
|
if (conf.get ("color", true))
|
||||||
{
|
{
|
||||||
if (overdue)
|
if (overdue)
|
||||||
table.setCellFg (row, 1, Text::red);
|
table.setCellFg (row, 1, Text::colorCode (conf.get ("color.overdue", "red")));
|
||||||
else if (imminent)
|
else if (imminent)
|
||||||
table.setCellFg (row, 1, Text::yellow);
|
table.setCellFg (row, 1, Text::colorCode (conf.get ("color.due", "yellow")));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -858,9 +858,9 @@ std::string handleLongList (TDB& tdb, T& task, Config& conf)
|
|||||||
if (fg == Text::nocolor)
|
if (fg == Text::nocolor)
|
||||||
{
|
{
|
||||||
if (overdue)
|
if (overdue)
|
||||||
table.setCellFg (row, 3, Text::red);
|
table.setCellFg (row, 3, Text::colorCode (conf.get ("color.overdue", "red")));
|
||||||
else if (imminent)
|
else if (imminent)
|
||||||
table.setCellFg (row, 3, Text::yellow);
|
table.setCellFg (row, 3, Text::colorCode (conf.get ("color.due", "yellow")));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1187,9 +1187,9 @@ std::string handleReportNext (TDB& tdb, T& task, Config& conf)
|
|||||||
if (fg == Text::nocolor)
|
if (fg == Text::nocolor)
|
||||||
{
|
{
|
||||||
if (overdue)
|
if (overdue)
|
||||||
table.setCellFg (row, 3, Text::red);
|
table.setCellFg (row, 3, Text::colorCode (conf.get ("color.overdue", "red")));
|
||||||
else if (imminent)
|
else if (imminent)
|
||||||
table.setCellFg (row, 3, Text::yellow);
|
table.setCellFg (row, 3, Text::colorCode (conf.get ("color.due", "yellow")));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1969,9 +1969,9 @@ std::string handleReportActive (TDB& tdb, T& task, Config& conf)
|
|||||||
if (fg == Text::nocolor)
|
if (fg == Text::nocolor)
|
||||||
{
|
{
|
||||||
if (overdue)
|
if (overdue)
|
||||||
table.setCellFg (row, 3, Text::red);
|
table.setCellFg (row, 3, Text::colorCode (conf.get ("color.overdue", "red")));
|
||||||
else if (imminent)
|
else if (imminent)
|
||||||
table.setCellFg (row, 3, Text::yellow);
|
table.setCellFg (row, 3, Text::colorCode (conf.get ("color.due", "yellow")));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2227,9 +2227,9 @@ std::string handleReportOldest (TDB& tdb, T& task, Config& conf)
|
|||||||
if (fg == Text::nocolor)
|
if (fg == Text::nocolor)
|
||||||
{
|
{
|
||||||
if (overdue)
|
if (overdue)
|
||||||
table.setCellFg (row, 3, Text::red);
|
table.setCellFg (row, 3, Text::colorCode (conf.get ("color.overdue", "red")));
|
||||||
else if (imminent)
|
else if (imminent)
|
||||||
table.setCellFg (row, 3, Text::yellow);
|
table.setCellFg (row, 3, Text::colorCode (conf.get ("color.due", "yellow")));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2375,9 +2375,9 @@ std::string handleReportNewest (TDB& tdb, T& task, Config& conf)
|
|||||||
if (fg == Text::nocolor)
|
if (fg == Text::nocolor)
|
||||||
{
|
{
|
||||||
if (overdue)
|
if (overdue)
|
||||||
table.setCellFg (row, 3, Text::red);
|
table.setCellFg (row, 3, Text::colorCode (conf.get ("color.overdue", "red")));
|
||||||
else if (imminent)
|
else if (imminent)
|
||||||
table.setCellFg (row, 3, Text::yellow);
|
table.setCellFg (row, 3, Text::colorCode (conf.get ("color.due", "yellow")));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2705,13 +2705,26 @@ std::string handleCustomReport (
|
|||||||
<< "# sort " << sortList << std::endl
|
<< "# sort " << sortList << std::endl
|
||||||
<< "# filter " << filter << std::endl;
|
<< "# filter " << filter << std::endl;
|
||||||
|
|
||||||
|
// TODO Load pending tasks.
|
||||||
|
std::vector <T> tasks;
|
||||||
|
tdb.allT (tasks);
|
||||||
|
// filter (tasks, task);
|
||||||
|
|
||||||
|
// TODO Apply filters.
|
||||||
|
|
||||||
Table table;
|
Table table;
|
||||||
table.setTableWidth (width);
|
table.setTableWidth (width);
|
||||||
|
|
||||||
// TODO Load pending tasks.
|
foreach (col, columns)
|
||||||
// TODO Apply filters.
|
{
|
||||||
// TODO Add columns.
|
// TODO Add column.
|
||||||
// TODO Add data.
|
// TODO Add underline.
|
||||||
|
|
||||||
|
// TODO Add data.
|
||||||
|
foreach (t, tasks)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
std::stringstream out;
|
std::stringstream out;
|
||||||
if (table.rowCount ())
|
if (table.rowCount ())
|
||||||
|
|||||||
Reference in New Issue
Block a user