mirror of
https://github.com/nvbn/thefuck.git
synced 2025-01-18 20:11:17 +00:00
Correct "apt uninstall" -> "apt remove" (#950)
* Correct "apt uninstall" -> "apt remove" * remove unused import
This commit is contained in:
parent
c53676e42f
commit
3bbd0e9463
@ -116,6 +116,8 @@ def test_get_operations(set_help, app, help_text, operations):
|
|||||||
apt_get_help, 'apt-get install vim'),
|
apt_get_help, 'apt-get install vim'),
|
||||||
('apt saerch vim', invalid_operation('saerch'),
|
('apt saerch vim', invalid_operation('saerch'),
|
||||||
apt_help, 'apt search vim'),
|
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):
|
def test_get_new_command(set_help, output, script, help_text, result):
|
||||||
set_help(help_text)
|
set_help(help_text)
|
||||||
|
@ -53,5 +53,10 @@ def _get_operations(app):
|
|||||||
@sudo_support
|
@sudo_support
|
||||||
def get_new_command(command):
|
def get_new_command(command):
|
||||||
invalid_operation = command.output.split()[-1]
|
invalid_operation = command.output.split()[-1]
|
||||||
operations = _get_operations(command.script_parts[0])
|
|
||||||
return replace_command(command, invalid_operation, operations)
|
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)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user