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:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user