1
0
mirror of https://github.com/nvbn/thefuck.git synced 2024-10-05 18:31:10 +01:00

Correct "apt uninstall" -> "apt remove" (#950)

* Correct "apt uninstall" -> "apt remove"

* remove unused import
This commit is contained in:
thatneat 2019-09-17 11:02:45 -07:00 committed by Vladimir Iakovlev
parent c53676e42f
commit 3bbd0e9463
2 changed files with 9 additions and 2 deletions

View File

@ -116,6 +116,8 @@ def test_get_operations(set_help, app, help_text, operations):
apt_get_help, 'apt-get install vim'),
('apt saerch vim', invalid_operation('saerch'),
apt_help, 'apt search vim'),
('apt uninstall vim', invalid_operation('uninstall'),
apt_help, 'apt remove vim'),
])
def test_get_new_command(set_help, output, script, help_text, result):
set_help(help_text)

View File

@ -53,5 +53,10 @@ def _get_operations(app):
@sudo_support
def get_new_command(command):
invalid_operation = command.output.split()[-1]
if invalid_operation == 'uninstall':
return [command.script.replace('uninstall', 'remove')]
else:
operations = _get_operations(command.script_parts[0])
return replace_command(command, invalid_operation, operations)