Merge branch '2.4.3' into lexer2

This commit is contained in:
Paul Beckingham
2015-03-20 17:16:48 -04:00
49 changed files with 876 additions and 850 deletions

View File

@@ -529,10 +529,13 @@ void CLI::applyOverrides ()
////////////////////////////////////////////////////////////////////////////////
// Extract all the FILTER-tagged items.
const std::string CLI::getFilter ()
const std::string CLI::getFilter (bool applyContext /* = true */)
{
// Handle context setting
addContextFilter ();
// Commands that don't want to respect current context should leverage
// the applyContext argument
if (applyContext)
addContextFilter ();
std::string filter = "";
if (_args.size ())

View File

@@ -81,7 +81,7 @@ public:
void addRawFilter (const std::string& arg);
void analyze (bool parse = true, bool strict = false);
void applyOverrides ();
const std::string getFilter ();
const std::string getFilter (bool applyContext = true);
const std::vector <std::string> getWords ();
bool canonicalize (std::string&, const std::string&, const std::string&) const;
std::string getBinary () const;

View File

@@ -165,29 +165,29 @@ std::string Config::_defaults =
"\n"
"# Color controls.\n"
"color=on # Enable color\n"
#ifdef LINUX
#if defined(LINUX) || defined(DARWIN)
"\n"
"rule.precedence.color=deleted,completed,active,keyword.,tag.,uda.,project.,overdue,scheduled,due.today,due,blocked,blocking,recurring,tagged,pri.\n"
"\n"
"# General decoration\n"
"color.label=\n"
"color.label.sort=\n"
"color.alternate=on gray1\n"
"color.alternate=on gray2\n"
"color.header=color3\n"
"color.footnote=color3\n"
"color.warning=bold red\n"
"color.error=color3\n"
"color.debug=color3\n"
"color.error=white on red\n"
"color.debug=color4\n"
"\n"
"# Task state\n"
"color.completed=rgb010 on white\n"
"color.deleted=rgb100 on white\n"
"color.completed=\n"
"color.deleted=\n"
"color.active=rgb555 on rgb410\n"
"color.recurring=rgb013\n"
"color.scheduled=on rgb001\n"
"color.until=\n"
"color.blocked=white on color8\n"
"color.blocking=white on color15\n"
"color.blocking=black on color15\n"
"\n"
"# Project\n"
"color.project.none=\n"
@@ -251,15 +251,15 @@ std::string Config::_defaults =
"color.header=yellow\n"
"color.footnote=yellow\n"
"color.warning=bold red\n"
"color.error=yellow\n"
"color.debug=yellow\n"
"color.error=white on red\n"
"color.debug=blue\n"
"\n"
"# Task state\n"
"color.completed=green on white\n"
"color.deleted=red on white\n"
"color.completed=\n"
"color.deleted=\n"
"color.active=black on bright green\n"
"color.recurring=magenta\n"
"color.scheduled=on green\n"
"color.scheduled=white on green\n"
"color.until=\n"
"color.blocked=black on white\n"
"color.blocking=black on bright white\n"

View File

@@ -67,7 +67,7 @@ Filter::~Filter ()
////////////////////////////////////////////////////////////////////////////////
// Take an input set of tasks and filter into a subset.
void Filter::subset (const std::vector <Task>& input, std::vector <Task>& output)
void Filter::subset (const std::vector <Task>& input, std::vector <Task>& output, bool applyContext /* = true */)
{
context.timer_filter.start ();
_startCount = (int) input.size ();
@@ -75,7 +75,7 @@ void Filter::subset (const std::vector <Task>& input, std::vector <Task>& output
if (context.config.getInteger ("debug.parser") >= 1)
context.debug (context.cli.dump ("Filter::subset"));
std::string filterExpr = context.cli.getFilter ();
std::string filterExpr = context.cli.getFilter (applyContext);
if (filterExpr.length ())
{
Eval eval;
@@ -111,7 +111,7 @@ void Filter::subset (const std::vector <Task>& input, std::vector <Task>& output
////////////////////////////////////////////////////////////////////////////////
// Take the set of all tasks and filter into a subset.
void Filter::subset (std::vector <Task>& output)
void Filter::subset (std::vector <Task>& output, bool applyContext /* = true */)
{
context.timer_filter.start ();
@@ -119,7 +119,7 @@ void Filter::subset (std::vector <Task>& output)
context.debug (context.cli.dump ("Filter::subset"));
bool shortcut = false;
std::string filterExpr = context.cli.getFilter ();
std::string filterExpr = context.cli.getFilter (applyContext);
if (filterExpr.length ())
{
context.timer_filter.stop ();

View File

@@ -40,8 +40,8 @@ public:
Filter ();
~Filter ();
void subset (const std::vector <Task>&, std::vector <Task>&);
void subset (std::vector <Task>&);
void subset (const std::vector <Task>&, std::vector <Task>&, bool applyContext = true);
void subset (std::vector <Task>&, bool applyContext = true);
bool pendingOnly ();
void safety ();

View File

@@ -54,7 +54,7 @@ int CmdExport::execute (std::string& output)
// Apply filter.
Filter filter;
std::vector <Task> filtered;
filter.subset (filtered);
filter.subset (filtered, false);
// Obey 'limit:N'.
int rows = 0;

View File

@@ -135,7 +135,10 @@ CmdCompletionVersion::CmdCompletionVersion ()
int CmdCompletionVersion::execute (std::string& output)
{
#ifdef HAVE_COMMIT
output = COMMIT;
output = std::string (VERSION)
+ std::string (" (")
+ std::string (COMMIT)
+ std::string (")");
#else
output = VERSION;
#endif