Safety Valve Override
- Support 'allow.empty.filter', defaulting to 'yes', but if 'no' disallows the combination of a write command and an empty filter. Ordinarily this is just a warning that requires confirmation (thanks to Lee Lieske).
This commit is contained in:
@@ -259,6 +259,9 @@ void Filter::safety ()
|
||||
{
|
||||
if (context.parser.getFilterExpression () == "")
|
||||
{
|
||||
if (! context.config.getBoolean ("allow.empty.filter"))
|
||||
throw std::string (STRING_TASK_SAFETY_ALLOW);
|
||||
|
||||
// If user is willing to be asked, this can be avoided.
|
||||
if (context.config.getBoolean ("confirmation") &&
|
||||
confirm (STRING_TASK_SAFETY_VALVE))
|
||||
|
||||
Reference in New Issue
Block a user