mirror of
https://github.com/nvbn/thefuck.git
synced 2025-02-28 07:48:48 +00:00
#N/A Use get_closest
in no_command
rule
This commit is contained in:
parent
ef2f642ffe
commit
b5f2d0afb5
@ -1,5 +1,5 @@
|
|||||||
from difflib import get_close_matches
|
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
|
@sudo_support
|
||||||
@ -12,8 +12,7 @@ def match(command, settings):
|
|||||||
@sudo_support
|
@sudo_support
|
||||||
def get_new_command(command, settings):
|
def get_new_command(command, settings):
|
||||||
old_command = command.script.split(' ')[0]
|
old_command = command.script.split(' ')[0]
|
||||||
new_command = get_close_matches(old_command,
|
new_command = get_closest(old_command, get_all_executables())
|
||||||
get_all_executables())[0]
|
|
||||||
return ' '.join([new_command] + command.script.split(' ')[1:])
|
return ' '.join([new_command] + command.script.split(' ')[1:])
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user