Added a rule to delete sudo for pacaur. (#787)

This commit is contained in:
JunYoung Gwak
2018-02-22 13:14:02 -08:00
committed by Vladimir Iakovlev
parent b65e3a9aad
commit dd9554539f
3 changed files with 39 additions and 1 deletions
+15
View File
@@ -0,0 +1,15 @@
patterns = ['you cannot perform this operation as root']
def match(command):
if command.script_parts and command.script_parts[0] != 'sudo':
return False
for pattern in patterns:
if pattern in command.output.lower():
return True
return False
def get_new_command(command):
return ' '.join(command.script_parts[1:])