1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-03-14 06:38:32 +00:00

Merge bf3454d272f745f6791f1d4071af1b8507f2fba0 into c7e7e1d884d3bb241ea6448f72a989434c2a35ec

This commit is contained in:
Siavash 2024-05-11 07:26:25 +08:00 committed by GitHub
commit 4aa9e038cd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 2 deletions

View File

@ -184,6 +184,8 @@ def test_get_operations(set_help):
'dnf install vim'),
('dnf saerch vim', invalid_command('saerch'),
'dnf search vim'),
('dnf uninstall vim', invalid_command('uninstall'),
'dnf remove vim'),
])
def test_get_new_command(set_help, output, script, result):
set_help(help_text)

View File

@ -30,8 +30,11 @@ def _get_operations():
@sudo_support
def get_new_command(command):
misspelled_command = regex.findall(command.output)[0]
return replace_command(command, misspelled_command, _get_operations())
if misspelled_command == 'uninstall':
return [command.script.replace('uninstall','remove')
else:
misspelled_command = regex.findall(command.output)[0]
return replace_command(command, misspelled_command, _get_operations())
enabled_by_default = dnf_available