Verbosity
- New verbosity token 'filter' shows the complete filter used by the last command.
This commit is contained in:
@@ -81,6 +81,8 @@
|
|||||||
- Added details in debug mode, for unrecognized data (thanks to Kosta Harlan).
|
- Added details in debug mode, for unrecognized data (thanks to Kosta Harlan).
|
||||||
- Removed unused 'patterns' configuration variable.
|
- Removed unused 'patterns' configuration variable.
|
||||||
- Regular expressions are now enabled by default.
|
- Regular expressions are now enabled by default.
|
||||||
|
- New verbosity token 'filter' shows the complete filter used by the last
|
||||||
|
command.
|
||||||
|
|
||||||
------ current release ---------------------------
|
------ current release ---------------------------
|
||||||
|
|
||||||
|
|||||||
2
NEWS
2
NEWS
@@ -9,6 +9,8 @@ New Features in taskwarrior 2.4.0
|
|||||||
TAGGED.
|
TAGGED.
|
||||||
- The '_get' command properly uses exit codes.
|
- The '_get' command properly uses exit codes.
|
||||||
- Regular expressions are now enabled by default.
|
- Regular expressions are now enabled by default.
|
||||||
|
- The 'filter' verbosity token shows the complete filter used for hte last
|
||||||
|
command.
|
||||||
|
|
||||||
New commands in taskwarrior 2.4.0
|
New commands in taskwarrior 2.4.0
|
||||||
|
|
||||||
|
|||||||
@@ -254,6 +254,7 @@ control specific occasions when output is generated. This list may contain:
|
|||||||
special Feedback when applying special tags
|
special Feedback when applying special tags
|
||||||
project Feedback about project status changes
|
project Feedback about project status changes
|
||||||
sync Feedback about sync
|
sync Feedback about sync
|
||||||
|
filter Shows the filter used in the command
|
||||||
|
|
||||||
Note that the "on" setting is equivalent to all the tokens being specified,
|
Note that the "on" setting is equivalent to all the tokens being specified,
|
||||||
and the "nothing" setting is equivalent to none of the tokens being specified.
|
and the "nothing" setting is equivalent to none of the tokens being specified.
|
||||||
|
|||||||
30
src/A3t.cpp
30
src/A3t.cpp
@@ -554,18 +554,12 @@ const std::string A3t::getFilterExpression ()
|
|||||||
if (sequence != "")
|
if (sequence != "")
|
||||||
sequence = "( " + sequence + " )";
|
sequence = "( " + sequence + " )";
|
||||||
|
|
||||||
|
if (context.verbose ("filter"))
|
||||||
|
context.footnote ("Filter: " + sequence);
|
||||||
|
|
||||||
return sequence;
|
return sequence;
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Locate and extract the filter elements.
|
// Locate and extract the filter elements.
|
||||||
std::string filter = "";
|
std::string filter = "";
|
||||||
std::vector <Tree*>::iterator prev = _tree->_branches.begin ();
|
std::vector <Tree*>::iterator prev = _tree->_branches.begin ();
|
||||||
@@ -573,26 +567,16 @@ const std::string A3t::getFilterExpression ()
|
|||||||
{
|
{
|
||||||
if ((*i)->hasTag ("FILTER") && ! (*i)->hasTag ("PSEUDO"))
|
if ((*i)->hasTag ("FILTER") && ! (*i)->hasTag ("PSEUDO"))
|
||||||
{
|
{
|
||||||
// Two consecutive FILTER, non-OP arguments that are not "(" or ")" need
|
|
||||||
// an "and" operator inserted between them.
|
|
||||||
//
|
|
||||||
// ) <non-op> --> ) and <non-op>
|
|
||||||
// <non-op> ( --> <non-op> <and> (
|
|
||||||
// ) ( --> ) and (
|
|
||||||
// <non-op> <non-op> --> <non-op> and <non-op>
|
|
||||||
//
|
|
||||||
if (i != prev &&
|
if (i != prev &&
|
||||||
(((*prev)->hasTag ("FILTER") && ! (*prev)->hasTag ("OP")) || (*prev)->attribute ("raw") == ")") &&
|
(((*prev)->hasTag ("FILTER") && ! (*prev)->hasTag ("OP")) || (*prev)->attribute ("raw") == ")") &&
|
||||||
(! (*i)->hasTag ("OP") || (*i)->attribute ("raw") == "("))
|
(! (*i)->hasTag ("OP") || (*i)->attribute ("raw") == "("))
|
||||||
{
|
{
|
||||||
filter += " and";
|
filter += " and";
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ((*i)->hasTag ("ID") ||
|
else if ((*i)->hasTag ("ID") ||
|
||||||
(*i)->hasTag ("UUID"))
|
(*i)->hasTag ("UUID"))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ((*i)->hasTag ("ATTMOD"))
|
else if ((*i)->hasTag ("ATTMOD"))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -616,11 +600,7 @@ const std::string A3t::getFilterExpression ()
|
|||||||
prev = i;
|
prev = i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
if (sequence != "")
|
|
||||||
return "( " + sequence + " ) " + filter;
|
|
||||||
|
|
||||||
return filter;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ std::string Config::_defaults =
|
|||||||
"#verbose=no # Provide regular feedback\n"
|
"#verbose=no # Provide regular feedback\n"
|
||||||
"#verbose=nothing # Provide no feedback\n"
|
"#verbose=nothing # Provide no feedback\n"
|
||||||
"# # Comma-separated list. May contain any subset of:\n"
|
"# # Comma-separated list. May contain any subset of:\n"
|
||||||
"#verbose=blank,header,footnote,label,new-id,affected,edit,special,project,sync\n"
|
"#verbose=blank,header,footnote,label,new-id,affected,edit,special,project,sync,filter\n"
|
||||||
"confirmation=yes # Confirmation on delete, big changes\n"
|
"confirmation=yes # Confirmation on delete, big changes\n"
|
||||||
"indent.annotation=2 # Indent spaces for annotations\n"
|
"indent.annotation=2 # Indent spaces for annotations\n"
|
||||||
"indent.report=0 # Indent spaces for whole report\n"
|
"indent.report=0 # Indent spaces for whole report\n"
|
||||||
|
|||||||
@@ -515,7 +515,8 @@ bool Context::verbose (const std::string& token)
|
|||||||
verbosity[0] != "edit" && //
|
verbosity[0] != "edit" && //
|
||||||
verbosity[0] != "special" && //
|
verbosity[0] != "special" && //
|
||||||
verbosity[0] != "project" && //
|
verbosity[0] != "project" && //
|
||||||
verbosity[0] != "sync") //
|
verbosity[0] != "sync" && //
|
||||||
|
verbosity[0] != "filter") //
|
||||||
{
|
{
|
||||||
verbosity.clear ();
|
verbosity.clear ();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user