1from difflib import get_close_matches
2from thefuck.utils import get_all_executables
3from thefuck.specific.sudo import sudo_support
4
5
6@sudo_support
7def match(command, settings):
8 return 'not found' in command.stderr and \
9 bool(get_close_matches(command.script.split(' ')[0],
10 get_all_executables()))
11
12
13@sudo_support
14def get_new_command(command, settings):
15 old_command = command.script.split(' ')[0]
16 new_cmds = get_close_matches(old_command, get_all_executables(), cutoff=0.1)
17 return [' '.join([new_command] + command.script.split(' ')[1:])
18 for new_command in new_cmds]
19
20
21priority = 3000
22