From dbe1a94c7d005e5e8d32c3a0bf3ad01a186d7d41 Mon Sep 17 00:00:00 2001 From: Sergey Bugaev Date: Sat, 30 May 2015 19:40:01 +0300 Subject: [PATCH] Wrap apt-get rule in sudo_support Fixes sudo_support not working for no_command rule. --- thefuck/rules/apt_get.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/thefuck/rules/apt_get.py b/thefuck/rules/apt_get.py index b78bb743..1b727188 100644 --- a/thefuck/rules/apt_get.py +++ b/thefuck/rules/apt_get.py @@ -1,11 +1,12 @@ from thefuck import shells +from thefuck.utils import sudo_support try: import CommandNotFound except ImportError: enabled_by_default = False - +@sudo_support def match(command, settings): if 'not found' in command.stderr: try: @@ -17,7 +18,7 @@ def match(command, settings): # IndexError is thrown when no matching package is found return False - +@sudo_support def get_new_command(command, settings): c = CommandNotFound.CommandNotFound() pkgs = c.getPackages(command.script.split(" ")[0])