From b5f2d0afb573ccbea018d75c0fe0bd17ca1486e7 Mon Sep 17 00:00:00 2001 From: nvbn Date: Thu, 23 Jul 2015 23:42:29 +0300 Subject: [PATCH] #N/A Use `get_closest` in `no_command` rule --- thefuck/rules/no_command.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/thefuck/rules/no_command.py b/thefuck/rules/no_command.py index 9687018..f414ba3 100644 --- a/thefuck/rules/no_command.py +++ b/thefuck/rules/no_command.py @@ -1,5 +1,5 @@ from difflib import get_close_matches -from thefuck.utils import sudo_support, get_all_executables +from thefuck.utils import sudo_support, get_all_executables, get_closest @sudo_support @@ -12,8 +12,7 @@ def match(command, settings): @sudo_support def get_new_command(command, settings): old_command = command.script.split(' ')[0] - new_command = get_close_matches(old_command, - get_all_executables())[0] + new_command = get_closest(old_command, get_all_executables()) return ' '.join([new_command] + command.script.split(' ')[1:])