mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-09-09 18:50:39 +02:00
CmdCustom: Respect report.<name>.context configuration variable
This allows the user to configure if a specific report should (or should not) adhere to the currently active context. Closes #2560.
This commit is contained in:
parent
c195c59494
commit
ab29ef8326
3 changed files with 17 additions and 1 deletions
|
@ -59,6 +59,21 @@ CmdCustom::CmdCustom (
|
|||
_category = Category::report;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Whether a report uses context is defined by the report.<name>.context
|
||||
// configuration variable.
|
||||
//
|
||||
bool CmdCustom::uses_context () const
|
||||
{
|
||||
auto config = Context::getContext ().config;
|
||||
auto key = "report." + _keyword + ".context";
|
||||
|
||||
if (config.has (key))
|
||||
return config.getBoolean (key);
|
||||
else
|
||||
return _uses_context;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int CmdCustom::execute (std::string& output)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue