From 619af2638ad14c6390615b529442821f66724bc3 Mon Sep 17 00:00:00 2001 From: mcarton Date: Tue, 16 Feb 2016 22:27:01 +0100 Subject: [PATCH] Make sudo patterns lowercase --- thefuck/rules/sudo.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/thefuck/rules/sudo.py b/thefuck/rules/sudo.py index 51aea596..fd745661 100644 --- a/thefuck/rules/sudo.py +++ b/thefuck/rules/sudo.py @@ -1,12 +1,12 @@ patterns = ['permission denied', - 'EACCES', - 'pkg: Insufficient privileges', + 'eacces', + 'pkg: insufficient privileges', 'you cannot perform this operation unless you are root', 'non-root users cannot', - 'Operation not permitted', + 'operation not permitted', 'root privilege', - 'This command has to be run under the root user.', - 'This operation requires root.', + 'this command has to be run under the root user.', + 'this operation requires root.', 'requested operation requires superuser privilege', 'must be run as root', 'must run as root', @@ -16,10 +16,10 @@ patterns = ['permission denied', 'need root', 'needs to be run as root', 'only root can ', - 'You don\'t have access to the history DB.', + 'you don\'t have access to the history db.', 'authentication is required', - 'eDSPermissionError', - 'You don\'t have write permissions'] + 'edspermissionerror', + 'you don\'t have write permissions'] def match(command): @@ -27,8 +27,8 @@ def match(command): return False for pattern in patterns: - if pattern.lower() in command.stderr.lower()\ - or pattern.lower() in command.stdout.lower(): + if pattern in command.stderr.lower()\ + or pattern in command.stdout.lower(): return True return False